Javascript examples for jQuery Selector:id
Change id to new value
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script type="text/javascript"> window.onload=function(){/*from www .j a v a 2s . c o m*/ console.log($('#foo')); $('#foo').attr('id','hello'); } </script> </head> <body> <div id="foo"> hello </div> </body> </html>