Bug Tracker

Modify

Ticket #10249 (closed bug: wontfix)

Opened 22 months ago

Last modified 22 months ago

attr()

Reported by: denis.rudov@… Owned by: denis.rudov@…
Priority: low Milestone: None
Component: attributes Version: 1.6.3
Keywords: Cc:
Blocking: Blocked by:

Description

<div id="ctabs">

<ul>

<li value="ctab1" class="active">Закладка</li> <li value="ctab2">Закладка2</li>

</ul>

</div>

$("#ctabs ul li").click(function(){

v = $(this).attr('value');

v = 0; ??? });

return only if value="(integer)". it work normally?

Change History

comment:1 Changed 22 months ago by timmywil

  • Owner set to denis.rudov@…
  • Priority changed from undecided to low
  • Status changed from new to pending
  • Component changed from unfiled to attributes

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate:  http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

Keep in mind that the value attribute on an li is only valid(although deprecated) if used for a certain reason:  http://www.w3.org/TR/html4/struct/lists.html#adef-value-LI

This is why you are getting the values you are getting. It is default browser behavior.

However, to retrieve the value attribute instead of the property (which is being retrieved with .attr() for backwards compatbility reasons), use the raw function .getAttribute():  http://jsfiddle.net/timmywil/fb4fM/1/

comment:2 Changed 22 months ago by timmywil

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

Sorry, no need to make a test case. Force of habit.

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.