Try to search your question here, if you can't find : Ask Any Question Now ?

How to pass a variable into a input value on page load?

HomeCategory: stackoverflowHow to pass a variable into a input value on page load?
Avatargaurav asked 5 months ago

The input field is not printing the value generated from the function domainRef.

Here is my code :

<div id="divref" onpageshow="domainRef()">

<script>
function domainRef(){
var ref = document.referrer.toString();
 document.getElementById("test").value = ref ;
}                          
</script>
</div> 

<input type="hidden" id="test" value="">

1 Answers
Best Answer
AvatarArben answered 5 months ago
Your Answer

7 + 14 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com