<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="jquery-2.2.3.js"></script>
<!-- <script src="jquery1.8.0..min.js"> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js" type="text/javascript"></script>
<script
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#myButton').click(function() {
$("#myResults").html("");
$('input:text').each(function(index){
console.log($(this));
$("#myResults")
.append("<b>Input Type:</b> "
+ $(this).attr('type') + " ");
$("#myResults")
.append("<b>Value:</b> "
+ $(this).attr('value') + "<br/>");
});
});
});
</script>
<style>
</style>
</head>
<body>
<div id="myExample">
<%for(int i=0;i<2;i++){ %>
<p><input type="text" name="inputBox" id="myInputText1"></p><br><br>
<p><input type="text" name="inputBox" id="myInputText1"></p><br><br>
<p><input type="text" name="inputBox" id="myInputText1"></p>
<%} %>
<input id="myButton" type="button"
value="Click here to see only input Type=Text" />
<div id="myResults"></div>
</div>
</body>
</html>
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="jquery-2.2.3.js"></script>
<!-- <script src="jquery1.8.0..min.js"> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js" type="text/javascript"></script>
<script
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#myButton').click(function() {
$("#myResults").html("");
$('input:text').each(function(index){
console.log($(this));
$("#myResults")
.append("<b>Input Type:</b> "
+ $(this).attr('type') + " ");
$("#myResults")
.append("<b>Value:</b> "
+ $(this).attr('value') + "<br/>");
});
});
});
</script>
<style>
</style>
</head>
<body>
<div id="myExample">
<%for(int i=0;i<2;i++){ %>
<p><input type="text" name="inputBox" id="myInputText1"></p><br><br>
<p><input type="text" name="inputBox" id="myInputText1"></p><br><br>
<p><input type="text" name="inputBox" id="myInputText1"></p>
<%} %>
<input id="myButton" type="button"
value="Click here to see only input Type=Text" />
<div id="myResults"></div>
</div>
</body>
</html>
No comments:
Post a Comment