Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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>
 
PREVIOUS NEXT
Tagged: #jquery #data #attribute #exists
ADD COMMENT
Topic
Name
2+8 =