code_junkie

Get the value from one window to another window - javascript

Nov 12th, 2011
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <input type="text" id="the_value" />
  2. <a href="#" onclick="return updateURL()" id="the_link">Click me</a>
  3. <script type="text/javascript">
  4. function updateURL()
  5. {
  6. document.getElementById('the_link').href =
  7. 'site.com/index2.php?info=' +
  8. encodeURIComponent(document.getElementById('the_value'));
  9. return true;
  10. }
  11. </script>
Add Comment
Please, Sign In to add comment