@@ -93,12 +93,12 @@ QUnit.test( "attr(String)", function( assert ) {
93
93
assert . equal ( jQuery ( "#area1" ) . attr ( "maxLength" ) , "30" , "Check for maxLength attribute" ) ;
94
94
95
95
// using innerHTML in IE causes href attribute to be serialized to the full path
96
- jQuery ( "<a/ >" ) . attr ( {
96
+ jQuery ( "<a></a >" ) . attr ( {
97
97
"id" : "tAnchor5" ,
98
98
"href" : "#5"
99
99
} ) . appendTo ( "#qunit-fixture" ) ;
100
100
assert . equal ( jQuery ( "#tAnchor5" ) . attr ( "href" ) , "#5" , "Check for non-absolute href (an anchor)" ) ;
101
- jQuery ( "<a id='tAnchor6' href='#5' / >" ) . appendTo ( "#qunit-fixture" ) ;
101
+ jQuery ( "<a id='tAnchor6' href='#5'></a >" ) . appendTo ( "#qunit-fixture" ) ;
102
102
assert . equal ( jQuery ( "#tAnchor5" ) . prop ( "href" ) , jQuery ( "#tAnchor6" ) . prop ( "href" ) , "Check for absolute href prop on an anchor" ) ;
103
103
104
104
jQuery ( "<script type='jquery/test' src='#5' id='scriptSrc'></script>" ) . appendTo ( "#qunit-fixture" ) ;
@@ -136,7 +136,7 @@ QUnit.test( "attr(String)", function( assert ) {
136
136
assert . equal ( $img . attr ( "height" ) , "53" , "Retrieve height attribute on an element with display:none." ) ;
137
137
138
138
// Check for style support
139
- styleElem = jQuery ( "<div/ >" ) . appendTo ( "#qunit-fixture" ) . css ( {
139
+ styleElem = jQuery ( "<div></div >" ) . appendTo ( "#qunit-fixture" ) . css ( {
140
140
background : "url(UPPERlower.gif)"
141
141
} ) ;
142
142
assert . ok ( ! ! ~ styleElem . attr ( "style" ) . indexOf ( "UPPERlower.gif" ) , "Check style attribute getter" ) ;
@@ -158,11 +158,11 @@ QUnit.test( "attr(String)", function( assert ) {
158
158
$a = jQuery ( "<a href='#' onclick='something()'>Click</a>" ) . appendTo ( "#qunit-fixture" ) ;
159
159
assert . equal ( $a . attr ( "onclick" ) , "something()" , "Retrieve ^on attribute without anonymous function wrapper." ) ;
160
160
161
- assert . ok ( jQuery ( "<div/ >" ) . attr ( "doesntexist" ) === undefined , "Make sure undefined is returned when no attribute is found." ) ;
162
- assert . ok ( jQuery ( "<div/ >" ) . attr ( "title" ) === undefined , "Make sure undefined is returned when no attribute is found." ) ;
163
- assert . equal ( jQuery ( "<div/ >" ) . attr ( "title" , "something" ) . attr ( "title" ) , "something" , "Set the title attribute." ) ;
161
+ assert . ok ( jQuery ( "<div></div >" ) . attr ( "doesntexist" ) === undefined , "Make sure undefined is returned when no attribute is found." ) ;
162
+ assert . ok ( jQuery ( "<div></div >" ) . attr ( "title" ) === undefined , "Make sure undefined is returned when no attribute is found." ) ;
163
+ assert . equal ( jQuery ( "<div></div >" ) . attr ( "title" , "something" ) . attr ( "title" ) , "something" , "Set the title attribute." ) ;
164
164
assert . ok ( jQuery ( ) . attr ( "doesntexist" ) === undefined , "Make sure undefined is returned when no element is there." ) ;
165
- assert . equal ( jQuery ( "<div/ >" ) . attr ( "value" ) , undefined , "An unset value on a div returns undefined." ) ;
165
+ assert . equal ( jQuery ( "<div></div >" ) . attr ( "value" ) , undefined , "An unset value on a div returns undefined." ) ;
166
166
assert . strictEqual ( jQuery ( "<select><option value='property'></option></select>" ) . attr ( "value" ) , undefined , "An unset value on a select returns undefined." ) ;
167
167
168
168
$form = jQuery ( "#form" ) . attr ( "enctype" , "multipart/form-data" ) ;
@@ -180,7 +180,7 @@ QUnit.test( "attr(String) on cloned elements, #9646", function( assert ) {
180
180
181
181
assert . strictEqual ( input . clone ( true ) . attr ( "name" , "test" ) [ 0 ] . name , "test" , "Name attribute should be changed on cloned element" ) ;
182
182
183
- div = jQuery ( "<div id='tester' / >" ) ;
183
+ div = jQuery ( "<div id='tester'></div >" ) ;
184
184
div . attr ( "id" ) ;
185
185
186
186
assert . strictEqual ( div . clone ( true ) . attr ( "id" , "test" ) [ 0 ] . id , "test" , "Id attribute should be changed on cloned element" ) ;
@@ -299,7 +299,7 @@ QUnit.test( "attr(String, Object)", function( assert ) {
299
299
$input = jQuery ( "<input type='checkbox'/>" ) . attr ( "checked" , true ) ;
300
300
assert . equal ( $input . prop ( "checked" ) , true , "Setting checked updates property (verified by .prop)" ) ;
301
301
assert . equal ( $input [ 0 ] . checked , true , "Setting checked updates property (verified by native property)" ) ;
302
- $input = jQuery ( "<option/ >" ) . attr ( "selected" , true ) ;
302
+ $input = jQuery ( "<option></option >" ) . attr ( "selected" , true ) ;
303
303
assert . equal ( $input . prop ( "selected" ) , true , "Setting selected updates property (verified by .prop)" ) ;
304
304
assert . equal ( $input [ 0 ] . selected , true , "Setting selected updates property (verified by native property)" ) ;
305
305
@@ -592,7 +592,7 @@ QUnit.test( "removeAttr(String)", function( assert ) {
592
592
assert . expect ( 12 ) ;
593
593
var $first ;
594
594
595
- assert . equal ( jQuery ( "<div class='hello' / >" ) . removeAttr ( "class" ) . attr ( "class" ) , undefined , "remove class" ) ;
595
+ assert . equal ( jQuery ( "<div class='hello'></div >" ) . removeAttr ( "class" ) . attr ( "class" ) , undefined , "remove class" ) ;
596
596
assert . equal ( jQuery ( "#form" ) . removeAttr ( "id" ) . attr ( "id" ) , undefined , "Remove id" ) ;
597
597
assert . equal ( jQuery ( "#foo" ) . attr ( "style" , "position:absolute;" ) . removeAttr ( "style" ) . attr ( "style" ) , undefined , "Check removing style attribute" ) ;
598
598
assert . equal ( jQuery ( "#form" ) . attr ( "style" , "position:absolute;" ) . removeAttr ( "style" ) . attr ( "style" ) , undefined , "Check removing style attribute on a form" ) ;
@@ -692,7 +692,7 @@ QUnit.test( "prop(String, Object)", function( assert ) {
692
692
assert . equal ( jQuery ( "#select2" ) . prop ( "selectedIndex" ) , 3 , "Check for selectedIndex attribute" ) ;
693
693
assert . equal ( jQuery ( "#foo" ) . prop ( "nodeName" ) . toUpperCase ( ) , "DIV" , "Check for nodeName attribute" ) ;
694
694
assert . equal ( jQuery ( "#foo" ) . prop ( "tagName" ) . toUpperCase ( ) , "DIV" , "Check for tagName attribute" ) ;
695
- assert . equal ( jQuery ( "<option/ >" ) . prop ( "selected" ) , false , "Check selected attribute on disconnected element." ) ;
695
+ assert . equal ( jQuery ( "<option></option >" ) . prop ( "selected" ) , false , "Check selected attribute on disconnected element." ) ;
696
696
697
697
assert . equal ( jQuery ( "#listWithTabIndex" ) . prop ( "tabindex" ) , 5 , "Check retrieving tabindex" ) ;
698
698
jQuery ( "#text1" ) . prop ( "readonly" , true ) ;
@@ -837,16 +837,16 @@ QUnit.test( "option.prop('selected', true) affects select.selectedIndex (gh-2732
837
837
838
838
function addOptions ( $elem ) {
839
839
return $elem . append (
840
- jQuery ( "<option/ >" ) . val ( "a" ) . text ( "One" ) ,
841
- jQuery ( "<option/ >" ) . val ( "b" ) . text ( "Two" ) ,
842
- jQuery ( "<option/ >" ) . val ( "c" ) . text ( "Three" )
840
+ jQuery ( "<option></option >" ) . val ( "a" ) . text ( "One" ) ,
841
+ jQuery ( "<option></option >" ) . val ( "b" ) . text ( "Two" ) ,
842
+ jQuery ( "<option></option >" ) . val ( "c" ) . text ( "Three" )
843
843
)
844
844
. find ( "[value=a]" ) . prop ( "selected" , true ) . end ( )
845
845
. find ( "[value=c]" ) . prop ( "selected" , true ) . end ( ) ;
846
846
}
847
847
848
848
var $optgroup ,
849
- $select = jQuery ( "<select/ >" ) ;
849
+ $select = jQuery ( "<select></select >" ) ;
850
850
851
851
// Check select with options
852
852
addOptions ( $select ) . appendTo ( "#qunit-fixture" ) ;
@@ -856,7 +856,7 @@ QUnit.test( "option.prop('selected', true) affects select.selectedIndex (gh-2732
856
856
$select . empty ( ) ;
857
857
858
858
// Check select with optgroup
859
- $optgroup = jQuery ( "<optgroup/ >" ) ;
859
+ $optgroup = jQuery ( "<optgroup></optgroup >" ) ;
860
860
addOptions ( $optgroup ) . appendTo ( $select ) ;
861
861
$select . find ( "[value=b]" ) . prop ( "selected" , true ) ;
862
862
@@ -970,7 +970,7 @@ QUnit.test( "val()", function( assert ) {
970
970
assert . equal ( $button . val ( ) , "foobar" , "Value retrieval on a button does not return innerHTML" ) ;
971
971
assert . equal ( $button . val ( "baz" ) . html ( ) , "text" , "Setting the value does not change innerHTML" ) ;
972
972
973
- assert . equal ( jQuery ( "<option/ >" ) . val ( "test" ) . attr ( "value" ) , "test" , "Setting value sets the value attribute" ) ;
973
+ assert . equal ( jQuery ( "<option></option >" ) . val ( "test" ) . attr ( "value" ) , "test" , "Setting value sets the value attribute" ) ;
974
974
} ) ;
975
975
976
976
QUnit . test ( "val() with non-matching values on dropdown list" , function ( assert ) {
@@ -1029,7 +1029,7 @@ var testVal = function( valueObj, assert ) {
1029
1029
assert . equal ( document . getElementById ( "text1" ) . value , "" , "Check for modified (via val(null)) value of input element" ) ;
1030
1030
1031
1031
var j ,
1032
- $select = jQuery ( "<select multiple><option value='1'/ ><option value='2'/ ></select>" ) ,
1032
+ $select = jQuery ( "<select multiple><option value='1'></option ><option value='2'></option ></select>" ) ,
1033
1033
$select1 = jQuery ( "#select1" ) ;
1034
1034
1035
1035
$select1 . val ( valueObj ( "3" ) ) ;
@@ -1145,7 +1145,7 @@ QUnit.test( "val(select) after form.reset() (Bug #2551)", function( assert ) {
1145
1145
QUnit . test ( "select.val(space characters) (gh-2978)" , function ( assert ) {
1146
1146
assert . expect ( 37 ) ;
1147
1147
1148
- var $select = jQuery ( "<select/ >" ) . appendTo ( "#qunit-fixture" ) ,
1148
+ var $select = jQuery ( "<select></select >" ) . appendTo ( "#qunit-fixture" ) ,
1149
1149
spaces = {
1150
1150
"\\t" : {
1151
1151
html : "	" ,
@@ -1230,7 +1230,7 @@ var testAddClass = function( valueObj, assert ) {
1230
1230
j . addClass ( valueObj ( "asdf" ) ) ;
1231
1231
assert . ok ( j . hasClass ( "asdf" ) , "Check node,textnode,comment for addClass" ) ;
1232
1232
1233
- div = jQuery ( "<div/ >" ) ;
1233
+ div = jQuery ( "<div></div >" ) ;
1234
1234
1235
1235
div . addClass ( valueObj ( "test" ) ) ;
1236
1236
assert . equal ( div . attr ( "class" ) , "test" , "Make sure there's no extra whitespace." ) ;
@@ -1669,17 +1669,17 @@ QUnit.test( "coords returns correct values in IE6/IE7, see #10828", function( as
1669
1669
assert . expect ( 1 ) ;
1670
1670
1671
1671
var area ,
1672
- map = jQuery ( "<map / >" ) ;
1672
+ map = jQuery ( "<map></map >" ) ;
1673
1673
1674
- area = map . html ( "<area shape='rect' coords='0,0,0,0' href='#' alt='a' / >" ) . find ( "area" ) ;
1674
+ area = map . html ( "<area shape='rect' coords='0,0,0,0' href='#' alt='a'></area >" ) . find ( "area" ) ;
1675
1675
assert . equal ( area . attr ( "coords" ) , "0,0,0,0" , "did not retrieve coords correctly" ) ;
1676
1676
} ) ;
1677
1677
1678
1678
QUnit . test ( "should not throw at $(option).val() (#14686)" , function ( assert ) {
1679
1679
assert . expect ( 1 ) ;
1680
1680
1681
1681
try {
1682
- jQuery ( "<option/ >" ) . val ( ) ;
1682
+ jQuery ( "<option></option >" ) . val ( ) ;
1683
1683
assert . ok ( true ) ;
1684
1684
} catch ( _ ) {
1685
1685
assert . ok ( false ) ;
0 commit comments