I have a html code containing input field as below:
<input id="'+count+'" name="quan'+obj+'" type="button" data-quantity="1"/>
Whereas, id and name of input field are dynamic as shown above because id count and name obj are dynamic. (Ranges from 1-5)
That means at certain time, the above input field could be:
<input id="4" name="quan2" type="button" data-quantity="1"/>
Now, What I want to do is to get the data-quantity value of input field when my name of input field is quan3 OR quan(N) Whatever (N) would be.
data-quantity also contains dynamic value.
funcation get()
{
count=3;
obj=2;
// What to do here to get the value of data-quantity???????
}
Note: I have also tried this below but doesn't worked.
$(".quan" + obj).attr("data-quantity","4"); // NOT WORKED
$("#" + count).attr("data-quantity","4"); // NOT WORKED