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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:00:46+00:00 2026-06-01T20:00:46+00:00

my page is full of php-generated content split in div’s that have the same

  • 0

my page is full of php-generated content split in div’s that have the same class but no id’s. I want to show some buttons that allow me to manage, change and delete the div’s; the buttons should be able to change the class, delete the div and select the content of the div.
How can I do this? is there a way to set the button’s onclick action to something, say … onclick=”changetheclass(this)” that would actually change the class of the div containing this button?

Man I feel I’m not making any sense here 🙁
Did anyone understand what I’m talking about? If so, is there any possibility to do this?
Thanks in advance!
🙂

EDIT: this is one of the divs, so that you could understand what I’m talking about:

    <div class="box"><p>
    this is the content of the div
    <button onclick="change_the_class(this_div_or_something)">click here to change the class of the div</a>
    <button onclick="select_the_content(this_div_or_something)">click here to change the class of the div</a>
    <button onclick="delete_the_whole_div(this_div_or_something)">click here to change the class of the div</a>
</p></div>
  • 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-01T20:00:47+00:00Added an answer on June 1, 2026 at 8:00 pm

    Is this what you looking for ??

    <html>
        <head>
            <script type="text/javascript">
               function changeClass(elm) {
                   elm.parentNode.className ='newcss';
               }
    
               function deleteDiv(elm) {
                   var par = elm.parentNode;
                   var gran = par.parentNode;
                   gran.removeChild(par);
               }
            </script>
        </head>
        <body>
            <div class='test'>
                Hello
                <button onclick="javascript:changeClass(this);" value="Change CSS">CSS</button>
                <button onclick="javascript:deleteDiv(this);" value="Change CSS">Delete</button>
            </div>
            <div class='test'>
                Hello
                <button onclick="javascript:changeClass(this);" value="Change CSS">CSS</button>
                <button onclick="javascript:deleteDiv(this);" value="Change CSS">Delete</button>
            </div>
            <div class='test'>
                Hello
                <button onclick="javascript:changeClass(this);" value="Change CSS">CSS</button>
                <button onclick="javascript:deleteDiv(this);" value="Change CSS">Delete</button>
            </div>
            <div class='test'>
                Hello
                <button onclick="javascript:changeClass(this);" value="Change CSS">CSS</button>
                <button onclick="javascript:deleteDiv(this);" value="Change CSS">Delete</button>
            </div>
        </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page full of links that go to pdf's I want to
I've got three columns inside of a div that is the full page width.
I have a var that contains a full html page, including the head, html,
I have a page that will have a full size product image and 4
I have the following Helper that gets the FULL url of the current page
I have a page full of images that end with _off.jpg. I have an
I have a full working php script for user activation that I wrote. Fully
Now that most of the major browsers support full page zoom (at present, the
I have a full screen overlay for an About page, which sits over the
I have a website where I want the following page to function - it

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.