Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery call dynamically created class

instead of this:
$(".editBtn").on("click", function(){
  //do something
});

use this;
$("body").on("click", ".editBtn", function(){
  //do something
});
Comment

how to get the class name dynamically using jquery

var $classOfBtn = wpsc-buy-now-button-64;
Comment

how to get the class name dynamically using jquery

<input id="btn" class="wpsc-buy-now-button wpsc-buy-now-button-64" type="image"
    name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif"
    alt="PayPal - The safer, easier way to pay online" />
Comment

how to get the class name dynamically using jquery

$(document).ready(function () {
    var $allClasses = $("[name='submit']").attr('class').split(' ');
    for(var i=0; i < $allClasses.length; i++)
    {
        // Check $allClasses[i] here.
    }
});
Comment

how to get the class name dynamically using jquery

var className = $('#id').attr('class');
Comment

how to get the class name dynamically using jquery

$('.'+$classOfBtn)
Comment

how to get the class name dynamically using jquery

var classArray = $('input').attr('class').split(' ');
// So now you can declare variables
var classbtn1 = classArray[0];
var classbtn2 = classArray[1];
Comment

how to get the class name dynamically using jquery

var $classOfBtn = 'wpsc-buy-now-button-64';
Comment

how to get the class name dynamically using jquery

$('.' + $classOfBtn) //note the dot
Comment

how to get the class name dynamically using jquery

 $('.setvalue').on('click', function() {
       var id = $(this).data("id");
       var inp =  $('#applicantstatus_' + id).val();
Comment

how to get the class name dynamically using jquery

var id = $(this).attr("id")
Comment

how to get the class name dynamically using jquery

$(document).ready(function () {
    var $classOfBtn = $('#btn').attr('class').split(' ')[0] + '-64';
    alert($classOfBtn );
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: regex not ending with 
Javascript :: js object every 
Javascript :: javascript save result to file 
Javascript :: insert value to html input with javascript variable 
Javascript :: Dropzone already attached 
Javascript :: javascript remove dom element 
Javascript :: jquery watch checkbox change 
Javascript :: javascript convert to two decimal places 
Javascript :: js remove specific css property 
Javascript :: js are you sure alert 
Javascript :: strart a nextjs project 
Javascript :: jest mock react router params 
Javascript :: how to get sys time in js 
Javascript :: if odd js 
Javascript :: javascript is object array 
Javascript :: how to align placeholder in react native 
Javascript :: bash parse json 
Javascript :: directional light three js 
Javascript :: jquery select element based on for attribute 
Javascript :: js sentence to array 
Javascript :: javascript iterate over json 
Javascript :: jquery is triggered on every element with class name 
Javascript :: javascript lowercase string except first letter of every word 
Javascript :: javascript get name of element 
Javascript :: node.js read json file 
Javascript :: longest substring without repeating characters in javascript 
Javascript :: react native tabbed sticky view 
Javascript :: @viewchild elementref 
Javascript :: javascript json string 
Javascript :: nested array loop in javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =