Javascript examples for jQuery:Data Attribute
Change div tag data attribute
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.js"></script> <script type="text/javascript"> window.onload=function(){/*from w w w.ja v a 2 s. c o m*/ newData = ['hello'] $('div').attr('data-serie-data', newData) console.log($('div')) } </script> </head> <body> <div data-serie-data="[4.0,4.0,3.0,4.0,3.0]" id="chartContainer"> </div> </body> </html>