Simple question from a newbie to javascript / jQuery I cannot figure out. Maybe someone here can answer this.
Let's say I have a php script that loads thousands of rows and displays them one per line and each row has a userid associated with it.
Each row is displayed within a div andd each div has a unique id based on the userid.
So in my while loop I have
$id = "div${userid}";
then each line would be like
<div id='$id'>some info here </div>
My question is, if I were to trap for an onclick, normally I would
$('#div123').on('click', function() {
..
..
..
But since I don't know the names of the divs, how can I create at trap for an unknown?
$('#unknown').on('click', function() {
..
..
..
Thank you for taking the time to read this.
JT