The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

//create HTML string that is the button
var oElement = document.getElementById("print_button_node");
//Return an array of HTMLElements with the given class.
Array getElementsByClassName ("print_button_node")
// use 1) DOM, or 2)innerHTML to dynamically write button in any
"print_button_node" class (could be more than one)
var elements =
YAHOO.util.Dom.getElementsByClassName("print_button_node", 'span');
//retreive element collection, in a loop...
//decorate with button

a simple script: Help please!

I want to write a JavaScript that creates a button with a print event attached.

I want the script to get the class name "dynPrintButton" and then return the array "dynPrintButton" - How do I use innerHTML to dynamically write the button in any "dynPrintButton" class?

This is what I have so far in script, but I'm not sure if my script is straying me from my goal:
//create HTML string that is the button
var oElement = document.getElementByClassName("dynPrintButton");
//Return an array of HTMLElements with the given class.
Array getElementsByClassName ("dynPrintButton");
// use innerHTML to dynamically write button in any "print_button_node" class (could be more than one)
document.getElementByClassName("dynPrintButton").innerHTML;