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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:15:00+00:00 2026-05-26T02:15:00+00:00

Is this valid jQuery? Or have I mixed it up with regular JavaScript too

  • 0

Is this valid jQuery? Or have I mixed it up with regular JavaScript too much? In any case it is not working (I would expect it to print “testing” between the appropriate tags):

<script type="text/javascript">
  var testing = "testing";
  testIt=function() {
    $('#cont').html(testing);
  }
</script>

to be invoked when:

<input TYPE="button" NAME="button4" Value="Write" onClick="testIt()">

obviously there is a:

<div id="cont"> </div>

in the html.

  • 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-26T02:15:00+00:00Added an answer on May 26, 2026 at 2:15 am

    No, that’s not “mixing jQuery and Javascript” too much. jQuery is Javascript. You won’t ever have to worry about mixing them.

    I can’t reproduce your problem. Your code seems to be working fine. See it in this demo.

    That said, I think you should use a method that is more idiomatic to jQuery instead of mixing Javascript with the markup.

    I would recommend changing the NAME attribute

    NAME="button4"
    

    to an id attribute:

    id="button4
    

    and using this jQuery:

    var testing = "testing"; 
    $("#button4").click(function(){
      $("#cont").html(testing); 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is this a valid JQuery usage pattern to : <script type=text/javascript> $(body).prepend('<input type=hidden id=error
Is this a valid url parameter in jquery.ajax(), <script type=text/javascript> $(document).ready(function() { getRecordspage(); });
Is this a valid jQuery syntax :$('#id')[0];
Is this valid C++ (e.g. not invoking UB) and does it achieve what I
Easy question, it is valid to have overlapping spans in html? Example: <span id=1>This
I've inherited some javascript, and it's not all working as expected at the moment.
So I have this jQuery Validation plugin, and it has a custom success message.
I have a jQuery function called bindServingSizes which I call like this $(servingsizes).bindServingSizes(ingredientid); Where
I have an array of strings that are valid jQuery selectors (i.e. IDs of
I have the following Javascript code, where feed is a valid url to an

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.