why doesn't this javascript code work document.getElementsByClassName("para")[0].innerHTML.style.visibility = "hidden";

Kleo

I have this code that will make the relevant paragraph disappear:

var first = paragraph[0].innerHTML = " "

but can't figure out why the following line of code won't make the paragraph disappear:

document.getElementsByClassName("para")[0].innerHTML.style.visibility = "hidden";

user6448640

you don't need innerHTML, use

document.getElementsByClassName('para')[0].style.visibility = 'hidden';

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Why does my document.getElementsByClassName("obj").innerHTML doesn't work?

Why doesn't this document.innerHTML function work?

Applying style with Visibility.Visible to a hidden control doesn't work.

Why the Visibility doesn't work in flutter?

Javascript code doesn't work. Why?

Why document.getElementById() command doesn't work on my code?

document.getElementById("id").innerHTML doesn't work but console.log does. Why?

Why doesn't innerHTML work with white spaces?

how to disable this document.getElementById("failedUpdateMessage").style.visibility = "hidden"; in javascript

'innerHTML' doesn't work

Why doesn't document.body.style.backgroundImage work for the body element?

Why doesn´t the childNodes work in my JavaScript code?

Why my code to clone an array doesn't work JavaScript

Why doesn't this code work? Javascript if statement, else if statement

Why animation doesn't work in my JavaScript code?

Why doesn't this javascript code work in Internet Explorer?

My innerHTML doesn't work and I don't know why?

Why doesn't document.getElementById not work?

Why doesn't overflow work in my document?

Why doesn't this javascript work?

javascript $(document).on('click') doesn't work in html

Javascript code hiding a div doesn't work (CSS @media rule doesn't work either)- 'cannot read property style of null'

Why my functionality doesn't work after conditionally innerHTML?

Why element.innerHTML = string with date info doesn't work?

Visibility hidden to a jsp element via javascript code

getElementsByClassName doesn't work, but getElementById does?

My code doesn't work within a $(document).ready() function. Can anyone help me understand why?

my css code "overflow:hidden" doesn't work

Why Jquery $(#); doesn't work but Javascript document.getElementById works fine?