Bug Tracker

Modify

Ticket #2770 (closed bug: wontfix)

Opened 5 years ago

Last modified 5 years ago

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:
Blocking: Blocked by:

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> 

Change History

comment:1 Changed 5 years ago by scott.gonzal

  • Status changed from new to closed
  • Resolution set to wontfix

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.