Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] To DOM or not -- calendar popup


  • From: sclay at ufl.edu (Steve Clay)
  • Subject: [Javascript] To DOM or not -- calendar popup
  • Date: Wed Mar 29 13:43:10 2006

Wednesday, March 29, 2006, 1:58:48 PM, Bill Moseley wrote:
> 2) or in the script search for the input field and then append the
> <img>  to the field's parent node list?[1]

var myInput = document.getElementById('myInput');
var myImg = document.createElement('img');

if (myInput.nextSibling) {
    myInput.parentNode.insertBefore(myImg, myInput.nextSibling);
} else {
    myInput.parentNode.appendChild(myImg);
}

If you use an anchor (around the img) this could be keyboard accessible (if
the calendar widget is).

Steve
-- 
http://mrclay.org/