Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 702 characters in body
Source Link

I am learning Javascript.
I want to:

  1. Read a user input (a number that is inserted in to a link address)
  2. Insert the input into a hyperlink string.
  3. Launch the hyperlink.

I am able to read the input and create the string but I cannot get it to launch the website. The string looks correct, however, I am not sure if the problem is actually the string or that I am not launching it correctly. I am able to find examples of each step, but cannot seem to put them together.

Here is my current code: (can't test the link because I cannot see it).

function myLink() { var numberEntered = document.getElementById("lessNum").value; //Read input var lessonlink = 'http://www.ASmarterWayToLearn.com/js/' + numberEntered + '.html'; //Create link window.open(lessonLink); //Go to link document.getElementById("theLink").value = lessonLink; // check link address } Lesson Number:

Link:

 
I am sorry if this doesn't come out correctly. It look correct when I paste it.

 
<script type="text/javascript" > function myLink() { var numberEntered = document.getElementById("lessNum").value; //Read input var lessonlink = 'http://www.ASmarterWayToLearn.com/js/' + numberEntered + '.html'; //Create link window.open(lessonLink); //Go to link document.getElementById("theLink").value = lessonLink; // check link address } </script> <!-- Read Lesson number --> <form> Lesson Number:<br> <input type="text" id="lessNum" onBlur="myLink();"><p> <!-- Display link for verification --> Link:<br> <input type="text" id="theLink" style="width: 400px;"><p> </form> <p> 

I am learning Javascript.
I want to:

  1. Read a user input (a number that is inserted in to a link address)
  2. Insert the input into a hyperlink string.
  3. Launch the hyperlink.

I am able to read the input and create the string but I cannot get it to launch the website. The string looks correct, however, I am not sure if the problem is actually the string or that I am not launching it correctly. I am able to find examples of each step, but cannot seem to put them together.

Here is my current code: (can't test the link because I cannot see it).

function myLink() { var numberEntered = document.getElementById("lessNum").value; //Read input var lessonlink = 'http://www.ASmarterWayToLearn.com/js/' + numberEntered + '.html'; //Create link window.open(lessonLink); //Go to link document.getElementById("theLink").value = lessonLink; // check link address } Lesson Number:

Link:

 

I am learning Javascript.
I want to:

  1. Read a user input (a number that is inserted in to a link address)
  2. Insert the input into a hyperlink string.
  3. Launch the hyperlink.

I am able to read the input and create the string but I cannot get it to launch the website. The string looks correct, however, I am not sure if the problem is actually the string or that I am not launching it correctly. I am able to find examples of each step, but cannot seem to put them together.

Here is my current code: (can't test the link because I cannot see it). 
I am sorry if this doesn't come out correctly. It look correct when I paste it.

<script type="text/javascript" > function myLink() { var numberEntered = document.getElementById("lessNum").value; //Read input var lessonlink = 'http://www.ASmarterWayToLearn.com/js/' + numberEntered + '.html'; //Create link window.open(lessonLink); //Go to link document.getElementById("theLink").value = lessonLink; // check link address } </script> <!-- Read Lesson number --> <form> Lesson Number:<br> <input type="text" id="lessNum" onBlur="myLink();"><p> <!-- Display link for verification --> Link:<br> <input type="text" id="theLink" style="width: 400px;"><p> </form> <p> 
added 702 characters in body
Source Link

I am learning Javascript.
I want to:

  1. Read a user input (a number that is inserted in to a link address)
  2. Insert the input into a hyperlink string.
  3. Launch the hyperlink.

I am able to read the input and create the string but I cannot get it to launch the website. The string looks correct, however, I am not sure if the problem is actually the string or that I am not launching it correctly. I am able to find examples of each step, but cannot seem to put them together.

Here is my current code: (can't test the link because I cannot see it).

function myLink() { var numberEntered = document.getElementById("lessNum").value; //Read input var lessonlink = 'http://www.ASmarterWayToLearn.com/js/' + numberEntered + '.html'; //Create link window.open(lessonLink); //Go to link document.getElementById("theLink").value = lessonLink; // check link address } Lesson Number:

Link:

I am learning Javascript.
I want to:

  1. Read a user input (a number that is inserted in to a link address)
  2. Insert the input into a hyperlink string.
  3. Launch the hyperlink.

I am able to read the input and create the string but I cannot get it to launch the website. The string looks correct, however, I am not sure if the problem is actually the string or that I am not launching it correctly. I am able to find examples of each step, but cannot seem to put them together.

I am learning Javascript.
I want to:

  1. Read a user input (a number that is inserted in to a link address)
  2. Insert the input into a hyperlink string.
  3. Launch the hyperlink.

I am able to read the input and create the string but I cannot get it to launch the website. The string looks correct, however, I am not sure if the problem is actually the string or that I am not launching it correctly. I am able to find examples of each step, but cannot seem to put them together.

Here is my current code: (can't test the link because I cannot see it).

function myLink() { var numberEntered = document.getElementById("lessNum").value; //Read input var lessonlink = 'http://www.ASmarterWayToLearn.com/js/' + numberEntered + '.html'; //Create link window.open(lessonLink); //Go to link document.getElementById("theLink").value = lessonLink; // check link address } Lesson Number:

Link:

added 3 characters in body
Source Link
zessx
  • 68.9k
  • 29
  • 139
  • 166

I am learning Javascript. 
I want to:

  1. Read a user input (a number that is inserted in to a link address)
  2. Insert the input into a hyperlink string.
  3. Launch the hyperlink.

I am able to read the input and create the string but I cannot get it to launch the website. The string looks correct, however, I am not sure if the problem is actually the string or that I am not launching it correctly. I am able to find examples of each step, but cannot seem to put them together.

I am learning Javascript. I want to:

  1. Read a user input (a number that is inserted in to a link address)
  2. Insert the input into a hyperlink string.
  3. Launch the hyperlink.

I am able to read the input and create the string but I cannot get it to launch the website. The string looks correct, however, I am not sure if the problem is actually the string or that I am not launching it correctly. I am able to find examples of each step, but cannot seem to put them together.

I am learning Javascript. 
I want to:

  1. Read a user input (a number that is inserted in to a link address)
  2. Insert the input into a hyperlink string.
  3. Launch the hyperlink.

I am able to read the input and create the string but I cannot get it to launch the website. The string looks correct, however, I am not sure if the problem is actually the string or that I am not launching it correctly. I am able to find examples of each step, but cannot seem to put them together.

Source Link
Loading