Need Help with HTML Best Practices with the Dialog Widget (JQ UI)
Hello Forum!
Please see code below. Everything works fine, but according to many HTML validators, using <div>'s as children of <li>'s is not best practice. What would you suggest I use instead? <li> works as well, but I'd like to know if there are other acceptable ways as well.
Thanks!
HMTL
- <ul class="PM-list">
- <li class="dialog">Button 1</li>
- <div title="Content 1 Title">Content 1</div>
- <li class="dialog">Button 2</li>
- <div title="Content 2 Title">Content 2</div>
- </ul>
JS
- $(".dialog").each(function () {
- var dialog = $(this).next().dialog({ autoOpen: false });
- $(this).click(function () {
- dialog.dialog("open");
- });
- });