asked on
<span class="approx approx-grand user-selected-aedcurrencycode showHideUserSelectedCountry" data-rate="105" style="display: block;">105</span>
var spans = document.querySelectorAll(".showHideUserSelectedCountry");
var len = spans.length;
for (var i = 0; i < len; i++) {
spans[i].style.display = 'none';
}
$('span.showHideUserSelectedCountry').hide();
alert( $(".showHideUserSelectedCountry").length );
$(".showHideUserSelectedCountry").hide();
ASKER
ASKER
$('.user-selected-aedcurrencycode').each(function () {
var aedrate = $(this).data('aedrate');
var newaedrate = parseFloat(aedrate).toFixed(0).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")
$(this).html('AED ' + newaedrate);
//alert($(".showHideUserSelectedCountry").length);
var convertedValue = objCurrency.toCurrencyCode;
if (convertedValue == 'AED') {
// $(".showHideUserSelectedCountry").remove();
// $(this).style.display = 'none';
// $(this).css('display', 'none');
$(this).hide();
} else {
// $(this).addClass('showHideUserSelectedCountry');
// $(".showHideUserSelectedCountry").show();
// $(this).style.display = 'block';
//$(this).css('display', 'block');
$(this).show();
}
ASKER
f (convertedValue == 'AED') {
$(this).css('display', 'none');
$(this).css('visibility', 'hidden');
} else {
$(this).css('display', 'block');
$(this).css('visibility', 'visible');
}
HTML (HyperText Markup Language) is the main markup language for creating web pages and other information to be displayed in a web browser, providing both the structure and content for what is sent from a web server through the use of tags. The current implementation of the HTML specification is HTML5.
TRUSTED BY
ASKER
Yes, I gave you code spinet as function is too big and it will be confusing.Code is already in the ready method.
If I put alert in the code then I can see the alert in the function.
I tried with the code below but the span is not hiding, Please advise,
Open in new window