change the button value and color on click

I am training in PHP laravel web development

But I have two small tasks in the Frontend, and I don't have the time to learn the Frontend to get them done, please help with solving them.

I have 4 button and 1 p:

       <button> trans('navbar.Students')</buttom>
       <button> trans('navbar.Schools')</buttom>
       <button> trans('navbar.teachers')</buttom>
       <button> trans('navbar.teachers')</buttom>

                       <p> </p>   

I want the following: When the user presses one of the buttons:

   1- Change the button color.
   2- Putting the value of the button that was pressed in <p>.
  • example someone clicks button1: The button color will change to blue, and the p value will be

    Students



Read more here: https://stackoverflow.com/questions/66996846/change-the-button-value-and-color-on-click

Content Attribution

This content was originally published by Jad es at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: