开发者

Is it allowed to use '/' within the value of the id of a html-element [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

What are valid values for the id attribute in HTML?

Hi, I'm struggeling with the jQuery UI Tabs and the needed ids. Let me give you an example:

<div id="tabs">
  <ul>
    <li><a href="#messages/pn1">Link</a></li>
    <li><a href="#messages/pn2">Link</a></li>
  </ul>
  <div id="messages/pn1"></div>
  <div id="messages/pn2"></div>
</div>

Now when I click on the second tab i get an exception like "jQue开发者_JAVA百科ry UI Tabs: Mismatching fragment identifier." Isn't it allowed to user slashes in ids?


Sorry. HTML Spec indicates otherwise.

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

http://www.w3.org/TR/html40/types.html#type-name


It is not allowed. Take a look at here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜