Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

jquery if data attribute exists

<div id="dataTable" data-timer="10">

</div>


<script>
if (typeof $("#dataTable").data('timer') !== 'undefined') {
	alert("true");
} else{
	alert("false");
}
</script>
Comment

how to check if data attribute exists in jquery

if ($("#dataTable").data('timer')) {
  ...
}
Comment

PREVIOUS NEXT
Code Example
Typescript :: enum in ts 
Typescript :: --skip tests generate components - Angular 12 - skip-tests vs spec-false 
Typescript :: typescript append row in html table 
Typescript :: get random light color 
Typescript :: pass class to generic typescript 
Typescript :: td elements in same line 
Typescript :: absolute path react native 
Typescript :: provider in ethers.js 
Typescript :: react-excel-renderer nextjs error 
Typescript :: get formcontrol value 
Typescript :: nestjs mongoose schema 
Typescript :: typescript check if object is of type 
Typescript :: get object key value typescript 
Typescript :: how to get child element li beautifulsoup 
Typescript :: props vue typescript 
Typescript :: sweetalert2 
Typescript :: wc term_exists category 
Typescript :: dota 2 space to center hero 
Typescript :: craeting a method that can take any number of arguments in python 
Typescript :: filter posts by meta value wordpress 
Typescript :: tar: refusing to read archive contents from terminal (missing -f option?) tar: error is not recoverable: exiting now 
Typescript :: typescript get objects nested in object 
Typescript :: how to compile automatically in typescript 
Typescript :: Scripts may close only the windows that were opened by them 
Typescript :: typescript array of empty objects 
Typescript :: ts object field from variable 
Typescript :: props tsx 
Typescript :: mongodb nest.js 
Typescript :: dynamic key interface typescript 
Typescript :: bootstrap get elements id 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =