jquery - Using attributes that don't belong (HTML) -


this question has answer here:

let's have table this:

<table> <tr> <td>my house </td> <td>my car </td> </tr> </table> 

and using jquery, if clicked on 1 of them, want show value of item. okay practice store additional information in attribute value example , fetch using .attr()

jquery has .data() applying data. there data-xxxx attribute storing data while keeping html valid. whatever method works better you!


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -