Bug Tracker

Ticket #2770 (closed bug: wontfix)

Opened 7 months ago

Last modified 7 months ago

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

Reported by: codyx Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.4 Component: core
Version: 1.2.3 Keywords: attribute attr safari search
Cc: Needs: Review

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

Change History

Changed 7 months ago by scott.gonzalez

  • 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.

Note: See TracTickets for help on using tickets.