Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

set custom data attribute jquery

//set the custom data value
let mainDiv = $('#yourDivId').data('anyName', value);
//access the custom data value
mainDiv.data('anyName');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #custom #data #attribute #jquery
ADD COMMENT
Topic
Name
8+1 =