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?


Add an id:

<pre id="myId" ....

And then hide it with jquery:

addNewTest = function() {

or without jquery:

addNewTest = function() {
    document.getElementById('myId').style.display = 'none';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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