DekGenius.com
JAVASCRIPT
how to get the class name dynamically using jquery
var $classOfBtn = wpsc-buy-now-button-64;
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" />
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.
}
});
how to get the class name dynamically using jquery
var className = $('#id').attr('class');
how to get the class name dynamically using jquery
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];
how to get the class name dynamically using jquery
var $classOfBtn = 'wpsc-buy-now-button-64';
how to get the class name dynamically using jquery
$('.' + $classOfBtn) //note the dot
how to get the class name dynamically using jquery
$('.setvalue').on('click', function() {
var id = $(this).data("id");
var inp = $('#applicantstatus_' + id).val();
how to get the class name dynamically using jquery
var id = $(this).attr("id")
how to get the class name dynamically using jquery
$(document).ready(function () {
var $classOfBtn = $('#btn').attr('class').split(' ')[0] + '-64';
alert($classOfBtn );
});
© 2022 Copyright:
DekGenius.com