0

I'm designing a Chrome extension and I collect user input which form part of a URL: for example

var myTextField = document.getElementById("myTextarea");

window.open("http://www.somewebpage/" + myTextField +  
"/therestofit","this is a new window");

However when it executes it inserts:

object%20HTMLTextAreaElement 

into the URL instead of the user supplied component - any advice?

2
  • 2
    The input element is not its value. You have to retrieve the value with .value. Commented Jul 20, 2015 at 5:07
  • 2
    Try window.open("http://www.somewebpage/" + myTextField.value + "/therestofit","this is a new window"); Commented Jul 20, 2015 at 5:09

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.