Old 08-08-2005, 08:38   #1 (permalink)
fishtankmedia
Registered User
 
Join Date: May 2005
Posts: 5
Small javascript help

Hi guys,

Working on a small project that requires some JS.

The script creates a new text area and two buttons for every paragraph, user clicks to add a paragraph. The buttons allow the user to move the text between one text area and the other.

I simply want to output the variable paragraphNumber as an actual number rather than a reference to the variable

Code:
var up = container.appendChild(document.createElement('input')); up.setAttribute("type","button"); up.setAttribute("onClick",'moveParagraphUp(paragraphNumber);'); up.value = "up";

I feel like a dolt asking this but i've searched google and can't find a similiar script! Cheers.
-dave


Solved my own problem. Cheers.

Last edited by fishtankmedia : 08-08-2005 at 09:56. Reason: Problem solved!!
  Reply With Quote
Old 08-08-2005, 09:58   #2 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
try:

Code:
up.setAttribute("onClick",'moveParagraphUp('+paragraphNumber+');');
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8