html - Not working- incremental in input text's value in javascript on pageload -
i want increment input text's value on page load in javascript code-
<input id="myid" type="text" name="itemquantity[]" value="1"/> <script> localstorage['myid'] = document.getelementbyid('myid').value = parseint(localstorage['myid'] || '0', 10) + 1; </script>
code working fine have error when set code in javascript actual page
$('#left_bar .cart-info').append('<div class="shopp" id="each-'+thisid+'"> <div class="label">'+itemname+'<input type="hidden" name="itemname[]" value="'+itemname+'"/><input type="hidden" name="itemprice[]" value="'+itemprice+'"/>'+(localstorage["myid"] =document.getelementbyid("myid").value =parseint(localstorage["myid"] || "0", 10) + 1;)+'<input id="myid" type="text" name="itemquantity[]" value="1"/></div><div class="shopp-price">$<em>'+itemprice+'</em></div> <span class="shopp-quantity">1</span><img src="images/remove.png" class="remove" /><br class="all" /></div>');
suggest solutions.
thankyou
javascript html
No comments:
Post a Comment