articles

JQuery noConflict method

Sachindra Singh8234 21-Feb-2011

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>
 
    <scripttype="text/javascript"src="jquery.min.js">     </script>
    <scripttype="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



Updated 07-Sep-2019

Leave Comment

Comments

Liked By