Changeset 3856
- Timestamp:
- 11/19/07 16:07:44 (9 months ago)
- Location:
- trunk/jquery
- Files:
-
- 3 modified
-
src/core.js (modified) (1 diff)
-
test/index.html (modified) (2 diffs)
-
test/unit/core.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/core.js
r3844 r3856 1207 1207 maxlength: "maxLength", 1208 1208 selectedIndex: "selectedIndex", 1209 defaultValue: "defaultValue" 1209 defaultValue: "defaultValue", 1210 tagName: "tagName", 1211 nodeName: "nodeName" 1210 1212 } 1211 1213 }); -
trunk/jquery/test/index.html
r3839 r3856 41 41 <ol id="empty"></ol> 42 42 <form id="form" action="formaction"> 43 <input type="text" name="action" value="Test" id="text1" />43 <input type="text" name="action" value="Test" id="text1" maxlength="30"/> 44 44 <input type="text" name="text2" value="Test" id="text2" disabled="disabled"/> 45 45 <input type="radio" name="radio1" id="radio1" value="on"/> … … 56 56 <button id="button" name="button">Button</button> 57 57 58 <textarea id="area1" >foobar</textarea>58 <textarea id="area1" maxlength="30">foobar</textarea> 59 59 60 60 <select name="select1" id="select1"> -
trunk/jquery/test/unit/core.js
r3845 r3856 224 224 225 225 test("attr(String)", function() { 226 expect( 13);226 expect(20); 227 227 ok( $('#text1').attr('value') == "Test", 'Check for value attribute' ); 228 ok( $('#text1').attr('value', "Test2").attr('defaultValue') == "Test", 'Check for defaultValue attribute' ); 228 229 ok( $('#text1').attr('type') == "text", 'Check for type attribute' ); 229 230 ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' ); … … 237 238 ok( $('#text1').attr('name') == "action", 'Check for name attribute' ); 238 239 ok( $('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' ); 240 ok( $('#text1').attr('maxlength') == '30', 'Check for maxlength attribute' ); 241 ok( $('#text1').attr('maxLength') == '30', 'Check for maxLength attribute' ); 242 ok( $('#area1').attr('maxLength') == '30', 'Check for maxLength attribute' ); 243 ok( $('#select2').attr('selectedIndex') == 3, 'Check for selectedIndex attribute' ); 244 ok( $('#foo').attr('nodeName') == 'DIV', 'Check for nodeName attribute' ); 245 ok( $('#foo').attr('tagName') == 'DIV', 'Check for tagName attribute' ); 239 246 240 247 $('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path … … 270 277 271 278 test("attr(String, Object)", function() { 272 expect(1 2);279 expect(13); 273 280 var div = $("div"); 274 281 div.attr("foo", "bar"); … … 293 300 $("#name").attr('maxlength', '5'); 294 301 ok( document.getElementById('name').maxLength == '5', 'Set maxlength attribute' ); 302 $("#name").attr('maxLength', '10'); 303 ok( document.getElementById('name').maxLength == '10', 'Set maxlength attribute' ); 295 304 296 305 reset();