jQuery Show/Hide Example in Jsf

(Last Updated On: [post_updated])

jQuery Show/Hide Example in Jsf:

Program:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html">

<h:head>
	<script
		src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js">
	</script>

	<script>
		$(document).ready(function() {
			$("#content").hide();

			$("#show_button").click(function() {
				$("#content").show();

			});

			$("#hide_button").click(function() {
				$("#content").hide();

			});

		});
	</script>

</h:head>

<h:body>
	<h:commandButton value="show" id="show_button" />
	<h:commandButton value="hide" id="hide_button" />
	<div id="content">Welcome to Javadomain.in</div>
</h:body>

</html>

Output:

show hide jsf output

 

Recommended Books:

358 total views, 0 views today

Leave a Reply

Your email address will not be published. Required fields are marked *