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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:07:44+00:00 2026-05-21T09:07:44+00:00

i want to replace all between <p> tags with a simple word NotFound <p

  • 0

i want to replace all between <p> tags with a simple word NotFound

<p id='2'>
        <?php
        foreach ($d as $key=>$value) 
        {
                    extract($value);
                            if($key%4==0)
                            {
                                  echo "</tr>";
                                  echo"<tr>";
                            }
                    include('item.php');
        }
        echo"</table>";
        echo"</div>";

   ?>
 </p>

how can i do that using javaScript??

update:
i used that code in the javascript area:

<script type="text/javascript">
        window.onload=msg;
        function msg(){
            document.getElementById('1').onclick=clickhandlee;

            //
        }
        function clickhandlee(){
            var ps = document.getElementsByTagName('p');
        for(var i=0, max=ps.length; i<max; i++){
        ps[i].innerHTML = "NotFound";
      }

        }



        </script>

and the same previous code in the <body> tags

<p id='2'>
        <?php
        foreach ($d as $key=>$value) 
        {
                    extract($value);
                            if($key%4==0)
                            {
                                  echo "</tr>";
                                  echo"<tr>";
                            }
                    include('item.php');
          }
        echo"</table>";
        echo"</div>";

   ?>
 </p>

this is the included php template item.php

<td style='border: 0px none ; margin: 0px; padding: 0px; width: 240px;' align='right' valign='top'>
           <div style='margin-bottom: 10px;'>
    <table class='topic' border='0' cellpadding='0' cellspacing='0' align='right'>
    <tbody>
        <tr>
            <td style='background: url(&#039;style/$style/images/top_background.jpg&#039;) no-repeat left center; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous' align='center' height='35'>
                <div style='overflow: hidden; width: 230px;'>
                <a class='link' href='t<?=$id;?>-<?=$name;?>.html'>
                    <?=$name;?> </a>
                </div>
            </td>
        </tr>
        <tr>
            <td align='center' style="height: 197px">
                <a href='count-<?=$id;?>;.html'>
            <img src='<?=$photo;?>' class='image' border='0' width='220' height='170'/></a>
                <div dir='rtl' class='shortdes'><?=$shortdes;?></div>
            </td>
        </tr>
        <tr valign='top'>
            <td style='background: url(&#039;style/$style/images/footer_background.jpg&#039;) no-repeat left center; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; height: 29px;' align='center' height='35'>
            <a class='dlink' href='count-<?=$id;?>.html'>
                <div class='download' style="height: 17px">

                      التحميل : <?=$visits;?>
                    </div></a>

            </td>
        </tr>
    </tbody>
</table>
</div>
</td>
  • 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-21T09:07:45+00:00Added an answer on May 21, 2026 at 9:07 am

    Using Javascript

    Note comment by user DA – IDs cannot start with a number before HTML 5, so assume that the ID is spelled out (two) instead of the numeral (2) if not using HTML 5.

    If it is only for the <p> tag with id=two:

    document.getElementById("two").innerHTML = "NotFound";
    

    If it is for all <p> tags:

    var paragraphs = document.getElementsByTagName("p");
    for(var i = 0; i < paragraphs.length; i++) {
        paragraphs[i].innerHTML = "NotFound";
    }
    

    The key is the innerHTML tag of the DOM elements.

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

Sidebar

Related Questions

I'm trying to replace all instances of a word, say foo between some HTML
I have a string that I want to extract text between comment tags, manipulate
I want to find and replace all whitespace that is shown below between $
I have a template in word (.docx) format and want to replace some placeholders
This is a simple one. I want to replace a sub-string with another sub-string
Question is pretty self explanitory. I want to do a simple find and replace,
I want to replace all the occurances of ' in a string to ^,
In my html content, i want to replace all bold text with italic existing
I want to replace all text what start with { and end with }
I want a regex code , to replace all foo strings to bar ,

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.