Question: I'm currently using 

```
$('#myElement').prop('outerHTML')

```

to receive it's Object Model as a string.

The problem is, when I use 

```
$('#myElement').prop('outerHTML')

```

I can only get the attributes of the Element (like class, id, styles,...). When it comes to h3 tag or p tag, the string I received has to 'content' at all.

Is there a way in jQuery or Javascript that I can receive the Object Model with both it's attributes and contents? Thank you very much.

Answer: 
This script will done your job. Please follow::

```
<script type="text/javascript">
$(document).ready(function() {
    $("#myElement").wrap('</p>').parent().html(); // For getting full element as string
    $("#myElement").attr('YOUR_ATTR'); // For getting any attribute of that elemnt
});
</script>

```
Use `Object.attr()` function on main node `$('#myElement')`. See this once <http://api.jquery.com/attr/>