Side navigation
Ticket #4070: test-4070.html
File test-4070.html, 0.8 KB (added by dmethvin, October 14, 2009 02:44AM UTC)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>test</title>
<style type="text/css">
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
jQuery.fn.allids = function() {
return this.map(function(){ return this.name }).get().join('|');
};
// alerts nostuff|novalue on Firefox and nostuff on Chrome
alert($("input[type=text]:not([value])").allids());
// alerts nostuff|novalue on Firefox and novalue on Chrome
alert($("input[type=text][value='']").allids());
});
</script>
</head>
<body>
<input type="text" name="gotstuff" value="stuff">
<input type="text" name="nostuff" value="">
<input type="text" name="novalue">
</body>
</html>
Download in other formats:
Original Format
File test-4070.html, 0.8 KB (added by dmethvin, October 14, 2009 02:44AM UTC)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>test</title>
<style type="text/css">
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
jQuery.fn.allids = function() {
return this.map(function(){ return this.name }).get().join('|');
};
// alerts nostuff|novalue on Firefox and nostuff on Chrome
alert($("input[type=text]:not([value])").allids());
// alerts nostuff|novalue on Firefox and novalue on Chrome
alert($("input[type=text][value='']").allids());
});
</script>
</head>
<body>
<input type="text" name="gotstuff" value="stuff">
<input type="text" name="nostuff" value="">
<input type="text" name="novalue">
</body>
</html>