How can I hide the inline
text within the div
of class .test
without hiding the h1
element? This is a simplified example of a problem I'm having in a larger web application.
Some other guidelines are that I can't wrap the text in a span tag and I want to keep all of the content in the div so I can't simply erase and add back everything I want.
$(document).ready(function() {});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="test">
<h1>Hello World</h1>
"This is text"
</div>