Skip to main content

Bug Tracker

Side navigation

Ticket #6472: test.html
File test.html, 0.9 KB (added by boecko, August 03, 2010 09:05PM UTC)

same issue with empty attributes

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<div id="test">
  <div myattr="foobar">
	<div myattr="">second</div>
  </div>
</div>
<textarea id="log" style="width:40em;height:20em">
<div id="test">
  <div myattr="foobar">
	<div myattr="">second</div>
  </div>
</div>
</textarea>
<script type="text/javascript">
	function logger(msg) {
	  $('#log').append(msg + "\n");
	}
  jQuery(function() {
	  logger('init');
	  logger("$('#test *[myattr]').length              : " + $('#test *[myattr]').length );
	  logger("$('#test').find('*[myattr]').length      : " + $('#test').find('*[myattr]').length);
	  logger("$('#test').find('*[myattr=\"\"]').length   : " + $('#test').find('*[myattr=""]').length);
  });
</script>
</html>

Download in other formats:

Original Format