I have some simple code below:
<script>
$(function() {
$("h1").click(function(){
console.log((this));
$("p").toggle();
});
});
</script>
</head>
<body>
<h1>test</h1>
<p>If you click test, I will toggle.</p>
</body>
If I click on test I can toggle the visibility of the p tag. At the same time I am writing <h1>test</h1> to the console. What I want is to write the word test only to the console. How do I do that? Nothing I tried works.
Thanks,
Jim
Replace:
With