Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
Simple MooTools $$ Selector Problem
Brian Wong
Greenhorn
Posts: 7
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello, I have a simple HTML as below
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="mootools-core-1.3.2-full-compat.js"> </script> <script type="text/javascript"> window.addEvent('domready', function(){ $('listItem').setStyle('color', 'red'); $('superList').setStyle('border', '1px solid #000000'); alert($$('.lastItem').getFirst().get('text')); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <ul id="superList"> <li>List items</li> <li><a href="#">List item link</a></li> <li id="listItem">List item with an ID</li> <li class="lastItem">Last list item</li> </ul> </body> </html>
Simple enough? But the alert() didn't pop up. Can you please let me know why?
Thanks in advance!
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how use a <li>with <h:commandLink> ?
set values in a table from other
Question on how to implement multi level menu (navigation bar) in html/css
alert is not working
IE7 vs IE8 CSS behaviour
More...