You must Sign In to post a response.
  • Category: JQuery

    Custom Selector instead of $ and Jquery

    I faced a tricky question how to create custom selector in Jquery instead of $ and Jquery.

    Like we have use object notation $ or jquery

    But suppose user want to create custom like "Test". Could it possible if yes then please provide me the example.
  • #764726
    Hi jay,

    Yes it is possible. Please go through following URL's. You will get detailed knowledge about creating custom selector in jQuery:
    List of all available selectors:
    Find demo over here:
    Hope it helps.
    Shashikant Gurav

  • #764737
    Of course it is possible, please go through below thread and see how this can be achieved,

    Asheej T K

  • #764909
    Hai Jay,
    The Custom selectors can be created using JQuery by extending the JQuery library as below:

    jQuery.extend(jQuery.expr[':'], { myCustomSelector: function (e) {
    //write the definition for the custom selector here

    Hope it will be helpful to you.

    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)

  • Sign In to post your comments