hi i have HTML content like:
<div id="j_idt33:summary">
<ul id="j_idt33:summary2" class="summary">
<li style="margin-right: 85%; Color:red;">Some Error Message.</li>
</ul>
</div>
i want when the user click on a button to clear all the contents of that DIV to get output like:
<div id="j_idt33:summary">
</div>
is it possible to do something like that with JSF ? or achieve that with JavaScript ? what do you suggest guys ?
please advise.
In JavaScript side, you could do something like this:
Or when you’re using jQuery:
You only need to give the parent
NamingContainercompnent which has a HTML representation withid="j_idt33"(I guess it’s the<h:form>) a fixed ID so that the code is more robust. The generated ID may change with JSF impl/version and the component tree’s state.