set name value using data-id in javascript code example
Example 1: data id tag
var dataId = $(this).attr("data-id");
Example 2: set data-id javascript
var d = document.getElementById("test"); // Javascript
d.setAttribute('data-id' , 'Next'); //