I am getting a W3V validator error that I can't understand:
Line 31, Column 61: Attribute
name
not allowed on elementdiv
at this point.
That is this row:
<div name="message" class="jGrowl bottom-right errorGrowl"></div>
Full HTML:
<!DOCTYPE html> <html> <head> <title>jGrowl</title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script> <script type="text/javascript" src="data/awo-jgrowl.js"></script> <script type="text/javascript" src="data/shortcut.js"></script> <link rel="stylesheet" type="text/css" href="data/awo-jgrowl.css"> <script type="text/javascript"> $(document).ready(function() { $('div[name=message]').awomsg('Input message', {sticky: true}); }); shortcut.add("m",function() { $('div[name=message]').awomsg('Input message', {sticky: true}); }); shortcut.add("h",function() { alert('ur doin it wrong'); }); </script> </head> <body> <div name="message" class="jGrowl bottom-right errorGrowl"></div> </body> </html>
There is no name attribute for div elements. If you want to uniquely identify one, then use id . If you want to mark one as a member of a group, then use class . The only place you can use a name attribute (that hasn't been deprecated) is on form controls ( input , select , textarea and button ).
If you need to 'name' a div in order to address it from javascript or otherwise uniquely identify it on a page, you can use the id attribute. That said, most modern browsers will handle a name attribute on a div with no issues but it does not conform to HTML standards.
I found some entry from:
Markup Validation Error: "Attribute name not allowed on element at this point" error #HTML5
Just in case you intend to define a custom attribute, you have to prepend the attribute with "data-
".
So in this case, name would be: data-name=""
.
And you can reference it by 'div[data-name="value"]'
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With