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 -

image - ClassNotFoundException when add a prebuilt apk into system.img in android -