Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js check if div have another div

<script>
    window.onload = function() {
        var parentDiv = document.getElementById("commentBox");
        var childDiv = document.getElementById("comment1");
        if (parentDiv.contains(childDiv)) {
            alert("yes");
        } else {
            alert("no");
        }
    }
</script>
<div class="row leftpad collapse" id="commentBox">
    <div id="comment1">
        <div class="col-md-3 dir-rat-left"> <i class="fa fa-user-circle" aria-hidden="true"></i>
            <h6>James </h6>
        </div>
        <div class="col-md-9 dir-rat-right">
            <p class="removemarg">always available, always helpfull that goes the same for his team that work with him - definatley our first phone call.</p>
        </div>
    </div>
</div>
Comment

PREVIOUS NEXT
Code Example
Javascript :: change px string to number 
Javascript :: payloadtoolargeerror node js 
Javascript :: json limit express 
Javascript :: mongodb sort objectid 
Javascript :: key value json javascript 
Javascript :: react password hashing 
Javascript :: js string slicing 
Javascript :: js pad 2 
Javascript :: angularjs round to 2 decimal places input 
Javascript :: axios Request body larger than maxBodyLength limit 
Javascript :: append element to specific class 
Javascript :: javascript largest number in array 
Javascript :: react native environment variables 
Javascript :: refresh page by hand in react 
Javascript :: js fetch get params 
Javascript :: Navigator.pushReplacementNamed parameters 
Javascript :: set dynamic route in link react js 
Javascript :: eintegrity npm error 
Javascript :: async constructor javascript 
Javascript :: run on load js 
Javascript :: React count up on scroll 
Javascript :: change datetime format in js 
Javascript :: how to delete node_modules 
Javascript :: js calculate distance between two coordinates 
Javascript :: javascript select text in element 
Javascript :: node js get list of all names of object array 
Javascript :: how to add property to object in javascript 
Javascript :: add multiple class from array javascript 
Javascript :: reverse words javascript 
Javascript :: what is interpolatin in javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =