0

I have kept notification button in my header. When user click Get notified then it should replace by message Notified successfully

CODEPEN: CODEPEN

HTML

<li style="display:none" id="l1"><a href="#about">Notified soccessfully ..</a>
</li>
<li><a style="display:block" id="l2" href="#about">Email</a>
</li>
<li>
<div id="input-collection" class="input-group input-group-lg left-input-group">

JS

function notify()
{
  alert("hi");
  document.getElementById("l2").dispaly='none';
  document.getElementById("input-collection").dispaly='none';
  document.getElementById("l1").dispaly='block';
}

In codepen, donno what is the issue with my code.

1
  • 5
    Change dispaly to display and apply it to its style. Commented Dec 31, 2013 at 9:30

1 Answer 1

4

IT should be display not dispaly and you should provide .style

function notify()
{
    alert("hi");
    document.getElementById("l2").style.display='none'; // Changed
    document.getElementById("input-collection").style.display='none'; // Changed
    document.getElementById("l1").style.display='block'; // Changed
}

Code Pen

Sign up to request clarification or add additional context in comments.

5 Comments

thanks, still probelm persist. On button click 'notification box' should be replaced by message
@user3121782 I can see it's replaces email with the messesge! What else you require? Can you elaborate?
notification box should be disappeared. only notified successfully message should apear
@user3121782 Here is the solution Is that you want? :)

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.