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

  • Home
  • SEARCH
  • 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 213879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:19:14+00:00 2026-05-11T18:19:14+00:00

In the wikipedia entry Unobtrusive JavaScript there is an example of obtrusive JavaScript: <input

  • 0

In the wikipedia entry Unobtrusive JavaScript there is an example of obtrusive JavaScript:

<input type="text" name="date" onchange="validateDate(this);" />

The solution is the following:

<input type="text" name="date" />

window.onload = function(){ //Wait for the page to load.
    var inputs = document.getElementsByTagName('input');
    for(var i=0,l=inputs.length;i<l;i++){ 
        input = inputs[i];
        if(input.name && input.name=='date'){ 
            input.onchange = function(){ 
                validateDate();
            }
        }
    }
};

function validateDate(){
    //Do something when the content of the 'input' element with the name 'date' is changed.
}

Is there a way to generate the first code sample from the second? In other words, is it possible to “render” the HTML of a page after JavaScript has acted on it?

  • 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-11T18:19:15+00:00Added an answer on May 11, 2026 at 6:19 pm

    JavaScript can be used to render HTML (add elements to the DOM) and this is essentially what the solution does. However if you view the source of the page after the onchange event has been added you won’t see it – this is because browsers show the unaltered DOM only.

    If you want to browse the updated DOM then download Firebug for Firefox. I can’t recommend this tool enough!

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

Sidebar

Ask A Question

Stats

  • Questions 506k
  • Answers 506k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm not sure it this is usable for you, but… May 16, 2026 at 3:35 pm
  • Editorial Team
    Editorial Team added an answer <%: "some string" %> is equal to: <%= Html.Encode("some string")… May 16, 2026 at 3:35 pm
  • Editorial Team
    Editorial Team added an answer Writing an implementation of a regular expression engine is indeed… May 16, 2026 at 3:35 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

On Ring Buffer's Wikipedia entry , there's example code showing a hack for UNIX
In the 2009 Wikipedia entry for the Strategy Pattern, there's a example written in
According to this Wikipedia entry: Protocol Buffers is very similar to Facebook’s Thrift protocol,
For example using this Wikipedia dump: http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=lebron%20james&rvprop=content&redirects=true&format=xmlfm Is there an existing library for Python
The Wikipedia entry doesn't give details and the RFC is way too dense. Does
From the wikipedia entry on NP-Complete: The easiest way to prove that some new
So the Wikipedia entry on Lambda Calculus was interesting but I've finished it. I
I found the Wikipedia entry on the soft coding anti-pattern terse and confusing. So
According to the wikipedia entry on Rabin-Karp string matching algorithm, it can be used
On the wikipedia entry for k-d trees , an algorithm is presented for doing

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.