I need to pass some values from the database to the <li> tag. Is the following acceptable and is it the correct way?
<li id='$current_row["RA_SUB_ID"]' component_name='$current_row["RA_SUB_NAME"]' pub_id='$current_row["RA_SUB_PUBLIC_ID"]'>
Thanks for your help 🙂
An
litag only displays one text value (some browsers also support a value attribute). So it depends which one you want. You need to use the following syntax.Optionally you can set an ID to programatically access the element (using client side script, such as JavaScript)
Now if you’d like to set more data to access on the client side, you can use the
data-custom attributes.These can be accessed in jQuery usign the data function.