How to set a value present in anchor tag to a hidden field upon clicking on the hyperlink text(i.e. value present in anchor tag)?

I'm haiving following code:

<a class="que_issue" href="#">

Now I want to set the value 38552(only question id and not the string QUE) to the following hidden field:

<input type="hidden" name="question_id" id="question_id" value=""/>

Also note that the page shouldn't be redirected to another location as I'm showing the pop-up dialog on the click of above hyperlink. The script to show the pop-up dialog is working fine, no issue with that. There are many such hyperlinks containing different question ids(like QUE38552) are present on the same page. I want to set the value of hidden field of only that question id on which user has clicked. This hidden field is present on the diaolg pop-up which I'm going to show. Can anyone plese help me in this regard? Thanks in advance.




You can do:

$('.que_issue').click(function() {
    var number = $(this).text().match(/[0-9]+/g);

Fiddle Demo

Need Your Help

Getting a Java SecurityException while starting an activity

java android exception android-permissions

I am facing this weird situation where I am getting the below logs.

Xcode storyboard seque loops back to the same view

xcode loops view error-handling storyboard

I am using storyboard seques to change views to other parts of my app but when I linked my main view to the next and called for the seque in the function within my enter button it just loops back t...