Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Answer to your question : 01</strong></p> <p>To select different selector they need to be <strong>separated by comma</strong>, read more about <strong><a href="http://api.jquery.com/category/selectors/" rel="nofollow">jQuery Selectore</a></strong></p> <pre><code>$("#container").on('click', ":text[name=one], :text[name=two], :text[name=three]", function() { }); </code></pre> <p>is correct.</p> <p><strong>Answer to your question : 02</strong></p> <p>for multiple live event bind event name should be <strong>separated by comma</strong> also. Read more about <strong><a href="http://api.jquery.com/category/events/" rel="nofollow">jQuery events</a></strong>.</p> <p>In case of live event binding, we shouldn't use live because its deprecated. Instead of that we need to use <strong><a href="http://api.jquery.com/on" rel="nofollow">.on()</a></strong>.</p> <pre><code>// here #container is the parent of input[type=text] // which is already exits in DOM $("#container").on("blur click", "input[type=text]", function(){ }); </code></pre> <p>There is another option for live event delegation called <strong><a href="http://api.jquery.com/delegate" rel="nofollow">.delegate()</a></strong>. It implement like following:</p> <pre><code>$("#container").delegate("input[type=text]", "blur click", function(){ }); </code></pre> <p><strong>According to comment</strong></p> <h3>Want to send array of input fields as parameter of a function</h3> <pre><code>function handlerToInputs(inputParams) { var filter = inputParams.join(', '); $("#container").on("blur click", filter, function(){ }); } // on checkbox click you execute a function with inputs // if checkbox needs delegate event then // bind live event like above $(':checkbox').on('click', function() { hadlerToInputs([":text[name=one]", ":text[name=two]", ":text[name=three]"]); }); </code></pre> <h3>According to Edit</h3> <pre><code>$("#some_container").on('click', #btn_account_editfunction(){ flip_display_on_off( $("#btn_account_edit_cancel, #btn_account_save, #account_edit_form"), $("#btn_account_edit, #account_edit_static"), false,true); }); $("#some_container").on('click',"#btn_account_edit_cancel", function(){ flip_display_on_off( $("#btn_account_edit_cancel, #btn_account_save, #account_edit_form"), $("#btn_account_edit, #account_edit_static"), true,false); }); function flip_display_on_off($element_set1, $element_set2, flip1, flip2) { // making flip for first set of elements $element_set1.css('display', flip1 ? 'block' : 'none'); // making flip for second set of elements $element_set2.css('display', flip2 ? 'block' : 'none'); } </code></pre> <p><strong>NOTE</strong> I think you don't need any loopy.</p> <p>I hope you get all answers. Happy coding :(</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload