Skip to main content

Bug Tracker

Side navigation

#2770 closed bug (wontfix)

Opened May 01, 2008 07:46PM UTC

Closed May 01, 2008 08:58PM UTC

Can't change attr type to 'search' in Safari 3

Reported by: codyx Owned by:
Priority: major Milestone: 1.2.4
Component: core Version: 1.2.3
Keywords: attribute attr safari search Cc:
Blocked by: Blocking:
Description

Taken from mailing list, posted by Claudio Procida:

Apparently, jQuery can't set the "type" attribute of html input fields

to look like Cocoa search fields in Safari.

jQuery version: 1.2.3

Safari version: 3.1 (525.13)

Proof follows:

<html> 
<head> 
<script src="jquery-1.2.3.min.js"></script> 
<script> 
$(function() { 
// this works: 
//document.getElementById('s_f').setAttribute('type', 'search'); 
// these don't work: 
$('#s_f').attr('type', 'search'); 
$('#s_f').attr({type: 'search'}); 
}); 

</script> 
</head> 
<body> 
        <input type="text" id="s_f" /> 
</body> 
</html> 
Attachments (0)
Change History (1)

Changed May 01, 2008 08:58PM UTC by scott.gonzal comment:1

resolution: → wontfix
status: newclosed

jQuery doesn't support setting the type attribute. There are just too many problems and input elements are not meant to change type. The best you can do is remove the element and replace it with a new element of the desired type.