Thank you for your reply. It's a very interesting example Makes me learn
But I wasn't very clear in my first post, sorry about that. When I click <div> number one, I'd like its id to be appended. When I click <div> number two, I'd like its id to be appended next to the first id already appended. And if I click again <div> number one, I'd like its id to be removed from the <p>#ids. Same goes for <div> number two.
In other words: there can be more than one id appended, but if an id is already appended, we remove it.
'Hope I'm clear
Thanks again for your help.