ArnisR Posted February 27, 2011 Report Share Posted February 27, 2011 Kā pārbaudīt, vai JavaScript mainīgais 'text' satur simbolu "#" ??? var text = "#text"; if(text satur #) { darīt to un to; } Quote Link to comment Share on other sites More sharing options...
0 yancho Posted February 27, 2011 Report Share Posted February 27, 2011 (edited) var text = "#text"; if (text.indexOf("#")!=-1) { alert ('# atrasta' +text.indexOf("#")+ 'pozīcijā') } Edited February 27, 2011 by yancho Quote Link to comment Share on other sites More sharing options...
Question
ArnisR
Kā pārbaudīt, vai JavaScript mainīgais 'text' satur simbolu "#" ???
var text = "#text";
if(text satur #)
{
darīt to un to;
}
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.