How to get the value of span tag based on css class in jquery?
<span class="page-numbers current">3</span>
I used
var pageno = $(".page-numbers current").val();
alert(pageno);
it doesnt seem to work.any suggestion..
EDIT:i am using jquery pagination plugin for pagination… for first page 1 and prev are assigned css class class="page-numbers current
<span class="page-numbers current prev">Prev</span>
<span class="page-numbers current">1</span>
“.page-numbers” and “current” are 2 different css classes.
Your jQuery expects “current” to be inside of “.page-numbers”.
Also use text() for non-input elements.
This should work
EDIT: Furthermore, current hasn’t got a class (.) or id (#) prefix which means it’s looking for an element “current”, which doesn’t exist. Use #current or .current