How can you generate a jquery click when mouse is over something?

How can you generate a jquery click when mouse is over something?

Hi, I am currently trying to make a layout editor.  I am still trying to figure out who to do the whole thing.

So far know that jquery can create new elements and delete them by matching the ID. 

I know that jquery can find id's from elements. I used this .attr('id');  to get ids.

Here comes the problem it works great when buttons and the elements are not inside a div. yet when you click on a div you not just get the id of the div but also the elements inside the div.

I want to select the div by itself. I used the .click function and selected div,a,html,etc.  This might be the problem. I then thought about using the mouse over to first get the id and then use that click function. I haven't tried that out yet going to after this post. 

The overall goal is to select the html elements or element. If I right click on a div then it should only select the div code and nothing inside it. I was thinking that if you click on something after that click like another right click and press the button control it would select the inside stuff too.

Overall goal is to make a profile gui type editor where you click and drag stuff and can change the properties of the elements delete them and add new ones and position it anywhere on the page.

 One question I have... How would you be able to select individual html code? like if someone clicks on it how can I grab the exact html code?