JSFiddle - React, Tailwind, and code Playground

HTML

<a href="/q/10/Title">Title</a>

JavaScript

alert(/[\d]+/.exec($("a").attr("href")));