Add or set value in data-attribute using JQuery

+20 Add or set value in data-attribute JQuery <html> <head> <title>Codelizar JQuery Data Attribute</title> <script src=’https://code.jquery.com/jquery-3.4.1.js’></script> </head> <body> <div id=”mybox” data-boxval=”98″></div> <div id=”newbox” data-mygroup=””></div> </body> <script type=’text/javascript’> var new_value = $(‘#mybox’).data(‘boxval’); //get the value from div $(‘#newbox’).data(‘mygroup’,new_value); //set the value </script> </html>

How to get value of input type array in Java Script

+10 How to get value of input type array in Java Script <html> <head>Codelizar</head> <title>Codelizar Blogs</title> <body> <input type=”text” name=”username[]” value=”” /> <input type=”text” name=”username[]” value=”” /> <input type=”text” name=”username[]” value=”” /> <input type=”text” name=”username[]” value=”” /> <input type=”text” name=”username[]” value=”” /> <input type=”text” name=”username[]” value=”” /> <input type=”button” value=”getname” onclick=”functgetname();” /> </body> </html> <script …