본문 바로가기

Programming/Javascript

javascript에서 html로 값 전달

<script> 
	count_num = "12345"; 
	document.ex_form.target_name.value = count_num;
</script> 

<form method="post" name="ex_form" action="doService"> 
	<input type="hidden" name="target_name" value=""> 
	<input type="button" name="anything_name" value="submit" onclick=ex_form.submit();> 
</form>


hidden input의 value로 count_num 값 이동