Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery get option data attribute

$(this).find(':selected').data('id');
Comment

jquery get data attribute value

/* html */
<a data-id="123">link</a>

/* js */
$(this).attr("data-id") // returns string "123"

$(this).data("id") // returns number 123 (jQuery >= 1.4.3 only)
Comment

jquery select by data attribute

$('div[data-key=value]');
Comment

find element with data attribute jquery

$("ul").find(`[data-slide='${current}']`)
Comment

jquery find by data attribute

$('.slide-link[data-slide="0"]').addClass('active');
Comment

jquery find div with data attribute value

$("body").find("[data-searchme='" + var_value + "']"); 
Comment

jquery get element by data attribute

$("ul[data-slide='" + current +"']");
Comment

PREVIOUS NEXT
Code Example
Javascript :: loop 
Javascript :: dropzone clear files 
Javascript :: react router how to go back 
Javascript :: how to find parent table of tr in jquery 
Javascript :: pass number as a prop in react 
Javascript :: js proxy to array 
Javascript :: select2 get selected value 
Javascript :: regex do not contain 
Javascript :: remove all dots from string javascript 
Javascript :: js form submit listener 
Javascript :: vanilla javascript axios 
Javascript :: how to set session storage in javascript 
Javascript :: js is directory 
Javascript :: javascript get current date jalali 
Javascript :: calculate age based on date of birth in javascript 
Javascript :: console.log formdata 
Javascript :: resolveJsonModule 
Javascript :: check jquery version in chrome 
Javascript :: javascript sort chars in string 
Javascript :: javascript round float 
Javascript :: js convert nodelist to array 
Javascript :: apply back button to a react component 
Javascript :: sh: generated/aesprim-browser.js: Permission denied 
Javascript :: javascript replace two spaces with one 
Javascript :: scroll to javascript 
Javascript :: Bootstrap modal hide and show 
Javascript :: package.json: License should be a valid SPDX license expression 
Javascript :: active link color different in react js 
Javascript :: js document.getelementsbyclassname modify innertext 
Javascript :: javascript convert number to binary 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =