dizzy1 Posted June 30, 2009 Share Posted June 30, 2009 Im making a function where i pass a variable across and i think my syntax is wrong around "+item+". function test(item) { var MinusImage = "<img src='includes/image/Minus.gif' height='25px' width='25px' onclick='HideAnswer("+item+");' />"; } Thanks In Advance DIZZY Quote Link to comment Share on other sites More sharing options...
rhodesa Posted June 30, 2009 Share Posted June 30, 2009 is item a string? try this: function test(item) { var MinusImage = '<img src="includes/image/Minus.gif" height="25px" width="25px" onclick="HideAnswer(\''+item+'\');" />'; } Quote Link to comment Share on other sites More sharing options...
dizzy1 Posted June 30, 2009 Author Share Posted June 30, 2009 Cheers Worked Perfectly :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.