Home > DeveloperSection > Articles > JQuery noConflict method

JQuery noConflict method


JQuery JQuery 
Ratings:
0 Comment(s)
 4543  View(s)
Rate this:

JQuery noConflict method

In JQuery generally ($) dollar sign is an indication of using JQuery function but jQuery give us functionality to rename ($) dollar sign instead of other user define variable name. By using noConflict () method, user can define own variable name. In this article I am trying to show you, how we can use noConflict method in JQuery as shown below:

Syntax: var xyz=$.noConflict ();

Code:

    <title>JQuery noConflict method</title>

 

    <script type="text/javascript" src="jquery.min.js">     </script>

    <script type="text/javascript">

        var userdefine = $.noConflict();//creating user define varaible

        userdefine(document).ready(function() {

        userdefine("label").append("JQuery dollar($)sign has changed from user define variable name('userdefine'        });

    </script>

</head>

<body>

    <h2>

        JQuery noConfilct method</h2>

    <label>

    </label>

</body>

</html>

Screenshot

JQuery noConflict method

 


Don't want to miss updates? Please click the below button!

Follow MindStick