html5 - Submit button setting a value in javascript -


i have make button has value javascript variable

<script>     for(i=0; < count; i++)          {             var row = table.insertrow(table.rows.length);             var cell = row.insertcell(0);             cell.innerhtml = '<input type="submit" value=i onclick="somefunc(this.value)" />';         } </script> 

but when open page value i. how set value of in button.

wouldn't

cell.innerhtml = '<input type="submit" value="'+ + '" onclick="somefunc(this.value)" />'; 

so use value of instead of string i?


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -