1
I have a file index.html
multi-tagged <a>
the href
of them all point to the same file, detalhe.html
. In this file detalhe.html
i have tags for <image>
, <ul><li>
, <iframe>
, <h3>
, etc..
The point is that the content of these tags should be dynamic, that is, depending on which tag <a>
of the archive index.html
was clicked, the content of detalhe.html
should be different. Imagine a list of movies by clicking on each movie opens the file detalhe.html
that contains the details of that film (Genre, Duration, Director, Trailer, etc.).
I know that to modify an element the path is getElementById
but how to do this based on the tag <a>
which called the HTML file?
You will need to change the href of your links by setting, for example, the fragment:
detalhe.html#genero
. So, on the detail page, just check the value ofwindow.location.hash
and display its contents.– Woss
You could leave an example?
– Matheus Saraiva