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 9058357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:42:17+00:00 2026-06-16T14:42:17+00:00

I have a webpage with a textbox named title and a text editor window

  • 0

I have a webpage with a textbox named “title” and a text editor window that represents content.
I have this javascript variable:

var article = {"title" : "I am a title", "content" : "I am the content"};

I must admit and I’ve never ran into this kind of array before in javascript, that’s why I need help.

Here’s my code of the HTML page:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
...
<script type="text/javascript">
        var article = {"title" : "I am a title", "content" : "I am the content"};
    </script>


</head>
<body>
    <form name="myForm" method="post">
        <label>Title:</label><br />
        <input id="myTitle"></input><br /><br />
        <label>Content:</label><br />
        <textarea id="myContent" name="myContent" rows="15" cols="80" style="width: 80%">
</textarea><br /><br /> 
        <input type="submit" value="save" />
    </form>
</body>
</html>

What I need to add to the webpage functionality is this:

  1. When page loads, put in the title textbox and inside the textarea (where the text editor is) the values in the article variable (in this case “I am a title” in the title, and “I am the content” in the editor).
  2. Once I change the values inside those textbox and textarea, the variable itself should be updated to what I’ve written.

Unfortunately for me, I have never ran into this kind of variable, so I’d be glad for some guidance.

  • 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-06-16T14:42:18+00:00Added an answer on June 16, 2026 at 2:42 pm

    Try this:

    var article = {
        "title": "I am a title",
        "content": "I am the content"
    };
    
    $('#myTitle').val(article.title);
    $('#myContent').val(article.content);
    
    $('#target').click(function() {
        article.title = $('#myTitle').val();
        article.content = $('#myContent').val();
        alert(article.title + '\n' + article.content);
        return false;
    });​
    

    DEMO HERE

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

Sidebar

Related Questions

I have a webpage that is transferring A stylesheet as a text/plain MIME type.
I have a webpage that has a textbox. When the user enters information into
So I have this webpage built that has a photo gallery on the left
The problem: I have a webpage with 18 text box fields that I need
I have a webpage (htm) that has a textbox (going to change it to
I have a webpage where there are two buttons and a textbox. When the
i have a username textbox and a password textbox in the webpage. i want
I have a few asp:textbox controls in a form on a webpage, below is
I have a ASP.NET web page that contains many textboxes. Each textbox has a
I have a webpage that when landed on, will detect a user's physical location

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.