Skip to main content

Bug Tracker

Side navigation

Ticket #5252: test.html
File test.html, 0.5 KB (added by johnH, September 16, 2009 08:47AM UTC)

Example of attr not working correctly in IE.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<title>Jquery Bug</title> 
<script type="text/javascript" src="jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript"> 
	$(function(){
		$(":input").attr("onfocus","alert(this.id);");
	})
</script> 
</head> 
<body> 
<form id="test">
	Move the focus to this field and you shold get an alert.<input type="text" id="textid">
</form>
</body> 
</html>

Download in other formats:

Original Format