pass and set javascript variables as value on a get method
how do I call a javascript variable to be set as value on my get function?
i have this co开发者_如何学运维de:
<script type="text/javascript">
var imagelinks = $('div[name=content] a');
idno = imagelinks.attr('idno');
</script>
and i want idno to be set as value of my input type in a get function. this is the code:
<form method="GET" action="action.php">
<input id="i1" name="i1" value=" //this is where i want "idno" to be passed">
</form>
help pls!
Do you mean this:
$('#i1').val(idno);
<script type="text/javascript">
var imagelinks = $('div[name=content] a');
idno = imagelinks.attr('idno');
document.getElementById('i1').value = idno;
</script>
精彩评论