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" />
$('.setvalue').on('click', function() {
var id = $(this).data("id");
var inp = $('#applicantstatus_' + id).val();var className = $('#id').attr('class');
var $classOfBtn = 'wpsc-buy-now-button-64';
$(document).ready(function () {
var $classOfBtn = $('#btn').attr('class').split(' ')[0] + '-64';
alert($classOfBtn );
});
var id = $(this).attr("id")$('.'+$classOfBtn)
var $classOfBtn = wpsc-buy-now-button-64;
$('.' + $classOfBtn) //note the dot
$(document).ready(function () {
var $allClasses = $("[name='submit']").attr('class').split(' ');
for(var i=0; i < $allClasses.length; i++)
{
// Check $allClasses[i] here.
}
});
Also in JavaScript:
- touppercase javascript array
- access to xmlhttprequest at angular 8
- angular 8 remove cookies
- html form not submit on enter
- js oneline foreach
- open pdf in new tab javascript
- jquery don't empty specific form field after submit
- react native italic text
- js convert truthy
- get data from fetch api into variable
- how to access global scope in to local scope using javascript examples
- node check if running on localhost?
- javascript if undefined
- create react-native project
- jquery with svelte
- react set title of page
- graphql react filtering
- convert a string to array in javascript
- js change html lang
- next.js manifest generator
- col to right bootstrap
- document .ready
- outer.use() requires a middleware function but got a Object
- foreach and replace item based on condition