$(queryselector) and dj(queryselector) - functions


$(queryselector) and dj(queryselector) functions


$(queryselector) and dj(queryselector) functions
    
    $('#queyselector');
    

This Function Will Select the element where id is queyselector. The dj('#queyselector') function will exactly works same as $() Function. Here is a Tip Use queryselector as we use in css.
    
    dj('body .container #queyselector').hide();
    

This will make easiest way to target any selector . Here The Selector will Target The Element where id is queryselector and it is inside an element with class container . and the element will hide. Here, you can also use methods with this function. Like :-
    
    $('#queyselector').text('new text');
    
or
    
    dj('#queyselector').hide();
    

The List of methods of $() Function is Here ( Described ).


1. dj('#id').hide(); This Function will hide the element from html document.

    dj('#id').hide();
    
More About .hide() Method.
Parameters => none
See More->
2. dj('#id').alert(); This Function will alert the innerHTML of element. 
 Syntax :-

    dj('#id').alert();
    
More About .alert() Method.

    Parameters => none
See More->

Now, Some Combo of get and Set methods


3.dj(query).html(a); This Function will return the innerHTML of element. 
 Syntax :-

    dj('#id').html();
    


And if You want to set innerHTML of any element then pass the html in parameter of the html()
 Syntax :-

    dj('#id').html('<h1> New HTML Here </h1>');
    
The HTML of the Selected Element will be Changed.
More About .html(a) Method.

    Parameters => 1
See More->
4.dj(query).html(a); This Function will return the value of element. 
&nbp;Syntax :-

        dj('#id input').val();
        


And if You want to set value of any element then pass the value in parameter of the value()
 Syntax :-

        dj('#id input').val('<h1> New value Here </h1>');
        
The value of the Selected Element will be Changed.
More About .value(a) Method.

    Parameters => 1
See More->
5. dj(query).text(a); This Function will return the innerText of element. 
 Syntax :-

        dj('#id').text();
        


And if You want to set innerText of any element then pass the html in parameter of the html()
 Syntax :-

        dj('#id').text('<h1> New Text Here </h1>');
        
The HTML of the Selected Element will be Changed.
More About .text(a) Method.

    Parameters => 1
See More->

Post a Comment

Post a Comment (0)

Previous Post Next Post