Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

set data-id value jquery

$('#mydiv').attr('data-myval', 'Undertaker'); // sets 
 $('#mydiv').attr('data-myval'); // gets
Comment

add val in data-id jquery

var a = $('#mydiv').data('myval'); //getter

$('#mydiv').data('myval',20); //setter
Comment

PREVIOUS NEXT
Code Example
Javascript :: title case a sentence-javascript 
Javascript :: angular material change placeholder color 
Javascript :: brand icons in next js 
Javascript :: equivalent of useHistory in react 
Javascript :: query params vuejs 
Javascript :: javascript max length with elipsis 
Javascript :: how to run react build locally 
Javascript :: javascript code to loop through array 
Javascript :: canvas resize canvas 
Javascript :: how to remove trailing space in string js 
Javascript :: Print a number with commas as thousands separators in JavaScript 
Javascript :: install the same version of package in the package.json 
Javascript :: conditinally add object js 
Javascript :: how to check data type of javascript variable 
Javascript :: react data attributes event 
Javascript :: jquery wrap inner text 
Javascript :: moment locale 
Javascript :: axios try catch get error status cocxe 
Javascript :: javascript loop through all element children 
Javascript :: npm err! 503 service unavailable proxy 
Javascript :: javascript array unique values 
Javascript :: javascript foreach object key 
Javascript :: express get jwt token from header 
Javascript :: js get selection start from contenteditable 
Javascript :: allow only letters in div javascript 
Javascript :: jquery find highest value in array 
Javascript :: add 1 year to current date javascript 
Javascript :: allow only integer or float in text fields jQuery 
Javascript :: ajax add header 
Javascript :: jquery alert on href click 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =