I have one jquery method, and I used this method when I clicked a button. So in this code I have one line " $("#loadingMessage").css('padding-top','6%');" I need this line to be executed only once, when we call this method for the first time, later when I left this line.
So please help me find one way
whole script method below
$('#SearchButton').click(function() {
$(".spinner").css('visibility','hidden');
$("#loadingMessage").css('padding-top','6%');
loaderStart();
document.getElementById('loadinggif3').style.display = "block";
$("#loadinggif3").show();
$(".col-sm-9").css('visibility','hidden');
var str = $('#SearchText').val();
str = str.trim();
if(str=="") return false;
)};
source
share