Home › Forums › Back End › Try out my first PHP web app! › Reply To: Try out my first PHP web app!
September 21, 2014 at 5:26 pm
#183803
__
Participant
To clarify, there are really two problems here.
-
In your PHP, you are outputting elements in a loop, all with the same
id
:commentbox
,username
, and so forth. However, HTML expectsid
s to be unique.commentbox
should be a class name,username
should be a data attribute. Remove theid
s. -
In your JS, you’re using inline event handlers, which are very old (DOM0) and generally shouldn’t be used anymore. See my post above.