What I want to do is the following:- When the LI element is clicked, the "hidden" attribute is removed from the ASIDE element. How do I do that?
The current code that I'm using is obviously wrong. I know I could have used getElementById(), but I'd rather not under the circumstances. I was hoping to put the code in a function, so that I could use it with other list items
Question
Orbitron
I just need a very basic script. I never usually need to use script, which is why I haven't learned how to use it.
I tried having a go with the DOM thingamajigs myself, but I had no luck.
Here is the code that the script will interact with:-
<li class="preview clickable" onclick="this.lastChild.removeAttribute('hidden'); return false;"> <img src="https://www.example.com/" alt="example" /> <aside hidden="hidden" class="floatingbox"> ... </aside> </li>What I want to do is the following:- When the LI element is clicked, the "hidden" attribute is removed from the ASIDE element. How do I do that?
The current code that I'm using is obviously wrong. I know I could have used getElementById(), but I'd rather not under the circumstances. I was hoping to put the code in a function, so that I could use it with other list items
I'd appreciate any help. :)
Link to comment
Share on other sites
0 answers to this question
Recommended Posts