Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery get data-id

$(this).data("id") // will return the number 123
Comment

jquery get data-id

const dataId = $('#elementId').attr("data-id");
Comment

jquery get data-id

To get the contents of the attribute data-id (like in <a data-id="123">link</a>) ///you have to use

$(this).attr("data-id") // will return the string "123"

//or .data() (if you use newer jQuery >= 1.4.3)

$(this).data("id") // will return the number 123
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript Count the occurrences of a value in an array 
Javascript :: js mobile prevent image mousedown 
Javascript :: jquery grid disable sorting 
Javascript :: usehistory not found in react-router-dom 
Javascript :: disable option dropdown jquery 
Javascript :: how to check data type of javascript variable 
Javascript :: javascript trim each element in array 
Javascript :: javascript select all table rows 
Javascript :: react copy to clipboard 
Javascript :: nodemail self signed certificate in certificate chain 
Javascript :: javascript sleep 1 second 
Javascript :: once page loaded run function 
Javascript :: how to refresh the page using react 
Javascript :: jest setImmediate is not defined 
Javascript :: javascript prepend element to array 
Javascript :: node express post request json 
Javascript :: random alphabet generator node js 
Javascript :: javascript reserved words 
Javascript :: express get jwt token from header 
Javascript :: how to call create react app 
Javascript :: node parameter add memory 
Javascript :: new request javascript 
Javascript :: javascript check if value exists in array of objects 
Javascript :: communication with service worker 
Javascript :: loopback find or create 
Javascript :: add font awesome to vue 
Javascript :: change placeholder javascript 
Javascript :: int to octal javascript 
Javascript :: How to more than one slot in graph node in godot 
Javascript :: localstorage drop item 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =