Grabeorama Posted December 4, 2008 Share Posted December 4, 2008 1)How do I make it so that when a word or button is clicked, it changes a variable?Like if you clicked the words 'click me' it would add 1 to the variable $clicks2)How do I make it so that when a button is clicked, it adds text to a variable?When you click the button that says "bold" it would add the string "<b></b>" to the stringThanks for any help or suggestions ~grabeorama Link to comment Share on other sites More sharing options...
Synook Posted December 5, 2008 Share Posted December 5, 2008 You can't use PHP to do either of those things, as PHP can only run synchronous to pages loading. Link to comment Share on other sites More sharing options...
Grabeorama Posted December 5, 2008 Author Share Posted December 5, 2008 Would I have to use JavaScript instead? Link to comment Share on other sites More sharing options...
jeffman Posted December 5, 2008 Share Posted December 5, 2008 Yup. Look into events in general and onclick events in particular. Also look into setting/modifying the innerHTML of an element. Link to comment Share on other sites More sharing options...
Grabeorama Posted December 5, 2008 Author Share Posted December 5, 2008 Ok thanks, I'll have a look at that Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.