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?
gaurav asked 2 weeks 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
Arben answered 2 weeks ago
Your Answer

13 + 19 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com