Reputation: 449
<html>
<head>
<script src="jquery.min.js"></script>
</head>
<body>
<div id="disp">
<div>
hi how are u
</div>
<div style="position:absolute;left:50px;top:100px;">
hello
</div>
</div>
<script type="text/javascript">
$(function(){
$("#disp").css({"background-color":"#00ff00"});
});
</script>
</body>
</html>
here it's giving blue color for "hi how are u" but it's not reflect in next div because it's in position:absolute how to make it part of parent div
Upvotes: 0
Views: 69
Reputation: 381
I'm not sure I understand your question, but it looks to me like you need to do this:
$("#show").children();
This will return all the children DOM objects underneath the div with the ID "show". You can test it out by doing this command:
console.log($("#show").children());
This will post your objects to the console. Hope this helps!
Upvotes: 0
Reputation: 191819
.val
is used for the value property of <input>
s, the value of the selectedIndex option of <select>
s, et. al.
I'm not sure exactly what you want, but I think you mean to use .html
instead.
Upvotes: 1