-1

http://codepen.io/anon/pen/JdRJGz

I've tried for a while and it seems that the script is simply not running. I'm sure that I have js enabled , maybe there's a bug i didn't catch?

function hello(){
``getElementById("message").style.display="block";
  getElementById("block").style.display="block";
};

function disappear(){
  getElementById("message").style.display="none";
  getElementById("block").style.display="none";
};
1
  • The codepen you linked doesn't work because it's missing external files. Commented May 21, 2015 at 12:56

3 Answers 3

0

If you would open up the developer console, you'd see the problem immediately: getElementById() is not defined. You're looking for

  document.getElementById("message").style.display = "block";
Sign up to request clarification or add additional context in comments.

Comments

0

getElementById is a member of the Document object

Correct your code like

function hello(){
    document.getElementById("message").style.display="block";
    document.getElementById("block").style.display="block";
};

function disappear(){
    document.getElementById("message").style.display="none";
    document.getElementById("block").style.display="none";
};

http://codepen.io/anon/pen/OVRgmW

Comments

-1

here let me explain,this hello and disappear r two functions which will trigger when u do an event like button click or something in ur code, message is an id of an element u set in ur page, n ur calling it specifically using its id and ur setting its style. I dont knw how u want ur code to behave but with the given information this is the best assumption i can make.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.