jQuery .data multiple object and access it


this is how to use JQuery.data(), the example will  wrap the variable become to object

and how to access the data

<!DOCTYPE html>
  div { margin:5px; background:yellow; }
  button { margin:5px; font-size:14px; }
  <script src="jquery-1.4.2.min.js"></script>
  <div id='temp_data'>A div</div>
  <button>Get val from the div</button>
$("button").click(function(e) {

               '51': {'tambah':101, 'kurang':51}, 
               '52': {'tambah':102, 'kurang':52}, 
               '53': {'tambah':103, 'kurang':53} 



Published by


just to remember what i had known :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s