5

I have the following query. I have a <pre> tag and it has some text inside but i want to hide <pre> when a button is clicked. Following images shows code:

enter image description here

When this addNewTest() function is called on click, I want <pre> to be hidden. How can i achieve this?

1 Answer 1

7

Add an id:

<pre id="myId" ....

And then hide it with jquery:

addNewTest = function() {
    $('#myId').hide();
});

or without jquery:

addNewTest = function() {
    document.getElementById('myId').style.display = 'none';
});
0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.