Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get updated data-value in jquery

<div id="123" data-img-flag="1">
	<image src="abc.png">
</div>

<div id="432" data-img-flag="0">
	<image src="abc.png">
</div>
<script>
alert($(popImgId).data('img-flag')); // when we use data function to get the data attribute value wll get all time value loaded at the time of DOM loaded
alert($(popImgId).attr('data-img-flag')); // value will get lates. If we change/update value using jquery will get updated value 
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: firefox freeze page 
Javascript :: how to open a new browser window using a .bat 
Javascript :: javascript detect when element is at bottom of screen 
Javascript :: javascript add an element to an array 
Javascript :: javascript image to variable 
Javascript :: js instanceof 
Javascript :: js array.splice first element 
Javascript :: jest debugger node 
Javascript :: replace all javascript 
Javascript :: media queries generator script 
Javascript :: ng-if variable is undefined 
Javascript :: Error: A Route is only ever to be used as the child of element, never rendered directly. Please wrap your Route in a Route 
Javascript :: javascript regex named capture group 
Javascript :: react functional components 
Javascript :: how click button and redirect angular 
Javascript :: is digit javascript 
Javascript :: js array map 
Javascript :: pass argument to event listener javascript 
Javascript :: javascript cancel scroll 
Javascript :: jest Your test suite must contain at least one test. 
Javascript :: firebase signout 
Javascript :: react.createelement 
Javascript :: yup phone number validation 
Javascript :: get index in map javascript 
Javascript :: kick commands discord.js 
Javascript :: async function in javascript 
Javascript :: uppercase first letter javascript 
Javascript :: parseint javascript 
Javascript :: how to check if array 
Javascript :: local storage react 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =