Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#8439 closed bug (wontfix)

$(input element).val() returns reversed string under certain conditions

Reported by: anonymous Owned by:
Priority: low Milestone: 1.next
Component: attributes Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:


(Bug occurs on Firefox 3.6.14 (but not on Opera 11.01), using Google's jQuery 1.5.1.min).

Bit of an obscure one, this.

Run the code below, and type a string. The string will be echoed to the screen reversed.

Change the font-size near the end to anything other than 0, and rerun. The string will be echoed to the screen correctly.


  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
  <script type="text/javascript">
     $('#term_pass .display').text(  $('#passwordInput').val()   );  
     $('#term_pass .display').text(  $('#passwordInput').val()   );  

  <div id="term_pass">
   <span class="display"></span>

   <input style="font-size: 0px;"  type="password" id="passwordInput"/>

Why would the font-size of an input box influence the string contained within?

Not sure whether the bug is me, jQuery or Firefox.

Change History (3)

comment:1 Changed 12 years ago by anonymous

Bugger. I didn't see the jsFiddle warning until I submitted, and now I can't edit it. Sorry.

comment:2 Changed 12 years ago by Rick Waldron

Component: unfiledattributes
Priority: undecidedlow
Resolution: wontfix
Status: newclosed

Confirmed: http://jsfiddle.net/rwaldron/fd6xV/1/

As you can see, this is not a jQuery bug

comment:3 Changed 12 years ago by anonymous

Ah, thank you. I'll resubmit to Firefox.

Note: See TracTickets for help on using tickets.