if()为false时,如何编写其他脚本 [英] How do I script else , when if() is false
问题描述
$(div [id ='tabcontent'])。find('a')。each(function(){
if($(this).text()== 立即预订){
// if()为真时执行正确
}
});
//我如何写脚本{},当if()是故事时
我试过的:
$(div [id ='tabcontent'])。find('a')。each(function(){
if($(this).text()==立即预订){
//运行代码
}
});
//我试过这个
else {
//运行代码
}
(this).text()==立即预订){
//当if时它正确执行)是真的
}
});
//我怎么写脚本{},如果if ()是故事
我尝试过:
(div [id ='tabcontent'])。find('a')。each(function(){
if(< br>
(this).text()==立即预订){
//运行代码
}
});
//我试过这个
else {
//运行代码
}
$("div[id='tabcontent']").find('a').each(function () {
if ($(this).text() == "Book Now") {
// it is execute properly when if() is true
}
});
//how i script else{}, when if() is fale
What I have tried:
$("div[id='tabcontent']").find('a').each(function () {
if ($(this).text() == "Book Now") {
// run code
}
});
// i tried like this
else{
// run code
}解决方案(this).text() == "Book Now") {
// it is execute properly when if() is true
}
});
//how i script else{}, when if() is fale
What I have tried:
("div[id='tabcontent']").find('a').each(function () {
if (
(this).text() == "Book Now") {
// run code
}
});
// i tried like this
else{
// run code
}
这篇关于if()为false时,如何编写其他脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!