Create only one page in HTML that can change content with JS

This is my first post in StackOverflow, hope to be clear in explaining my problem.

I am working on a website in HTML that has one page with clickable elements. Each element opens a new page with its content, so what I have is an infinitive number of pages with different contents. What I want to do is create only one page that can change its content with JS in based on the element that was clicked.

The structure of my main page, that contais all the elements is this:

  <section>

      <div class="container">

         <div class="row">

           <div class="col-lg-4">
                <div class="team-item">
                    <img src=".." alt="team">
                    <div class="hover">
                      <a class="textHover" href="www.blabla.it/2019/blabla1/">Blabla1</a>
                    </div>
                </div>
            </div>

            <div class="col-lg-4">
                <div class="team-item">
                    <img src=".." alt="team">
                    <div class="hover">
                      <a class="textHover" href="www.blabla.it/2019/blabla2/">Blabla2</a>
                    </div>
                </div>
             </div>

           .....

         </div>

      </div>

  </section>

The href of <a> is different for every element. I want to create unique href, like: www.blablabla.it/2019/blbla/ for every element BUT this must be able to change its content thanks to JS code.

Is that possible?

67 thoughts on “Create only one page in HTML that can change content with JS”

  1. 253029 290191Howdy! I just want to give an enormous thumbs up for the fantastic info you might have here on this post. I will likely be coming back to your weblog for a lot more soon. 775018

    Reply

Leave a Comment