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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:18:13+00:00 2026-06-14T18:18:13+00:00

<html> <script src=http://code.jquery.com/jquery-latest.js></script> <script> $(div.block).each(index){ this.text(‘Fill this writing of divs with the classname block’)}

  • 0
<html>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script> 
        $("div.block").each(index){
            this.text('Fill this writing of divs with the classname "block"')} 
</script>

<body>
        <div>Not here</div> 
        <div class='block'>replace me -- not working, why?</div> 
        <div>Not here</div> 
        <div class='block'>replace me -- not working, why?</div>
</body>

</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-06-14T18:18:14+00:00Added an answer on June 14, 2026 at 6:18 pm

    You don’t need to use each – you can just call the text method on your entire selection:

    $("div.block").text('Fill this writing of divs with the classname "block"');
    

    Incidentally, your problem above was that you were using each incorrectly

    $("div.block").each(function(index, el){
        $(el).text('Fill this writing of divs with the classname "block"');
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

JS: The JS for client side validation of email field <script type=text/javascript src=http://code.jquery.com/jquery-latest.min.js> </script>
My code : HTML <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js"></script> <div id="map" style="width:500px; height:500px"></div>
I'm looking at the http://code.google.com/chrome/extensions/contentSecurityPolicy.html documentation and seeing: { ..., content_security_policy: script-src 'self' https://example.com;
Following Code given: http://jsfiddle.net/UsZG8/1/ <html> <head> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js></script> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js></script> <link rel=stylesheet
I have the following code: <html> <head> <script type=text/javascript language=javascript src=jquery/jquery-1.5.1.js></script> <script type=text/javascript language=javascript
I want to edit following code.(This code is come from [http://stackoverflow.com/a/9280414/945688] <!DOCTYPE html> <html>
<script src = https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js></script> <script type=text/javascript> //waits till the document is ready $(document).ready(function() {
Here is the HTML: <div class=categories> <h3> <img src=http://i.imgur.com/TThAk.gif /> <a href=/foo>Foo</a> <p class=subtext>heading</p>
This is my script: HTML Code: <script> function pickIt(pId){ if(document.getElementById(pId).checked==true){ document.getElementById(pId).checked=false; }else{ document.getElementById(pId).checked =
The html of this script is made with list items http://www.jeremymartin.name/projects.php?project=kwicks Where can I

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.