Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6192241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:54:36+00:00 2026-05-24T02:54:36+00:00

Can someone tell me or show me how to pass information from a HTML

  • 0

Can someone tell me or show me how to pass information from a HTML page to a linked .js file?

<head>
<script type="text/javascript" src="../javascripts/script.js"></script>
</head>

<form name="form1">
    <input type="text" name="input1" value autofocus="on">
    <button onClick= "chrome.tabs.create({url: getURL()});">Go</button>
</form>

This is part of a form I want to be completed, and the input value taken, combined with a pre-existing URL, and the end result opened in a new tab

function getURL()
{
    var site = "http://www.example.com/query?f=";
    var input = document.form1.input1.value
    var output = site + input;
    return output;
}

This is the function I’ll be using, but I can’t work out or don’t know yet how to link the input variable to the input1 form value. The .js file is linked, rather than inside the actual HTML file.

Help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:54:37+00:00Added an answer on May 24, 2026 at 2:54 am

    Elements with their IDs or names automatically mapped to hierarchically-organised properties under document, as in document.name1.name2, is a long-deprecated practice and doesn’t occur unless your document triggers quirks mode. Add an ID to the input element then use

    var input = document.getElementById('input_id_goes_here').value;
    

    instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please tell me how to show all privileges/rules from a specific user
Can someone tell/show me how to use PHP inside PHP. I'm trying to make
Can someone please tell me why this doesn't work? I'm trying to show and
Can someone please tell me how to get the DB2 provider to show up
Can someone tell me if it is possible to call another procedure from within
Can someone tell me if their is a way to limit text within div
Can someone tell me why it doesn't work? The eclipse doesn't show any erros
Can someone tell me why the code from Starting new code onwards does not
Can someone tell me how to modify this regex to allow periods in a
can someone tell me what seems to be the issue with this <?php $increment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.