是否可以在jquery中的按钮中应用if else条件? [英] Is it possible to apply if else conditions in buttons in jquery?
本文介绍了是否可以在jquery中的按钮中应用if else条件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是jquery的初学者。我想知道它是否可能有一个if else按钮。例如。我有3个按钮,每个按钮可以更改特定段落的内容。当我点击其中一个按钮时,另外两个按钮将隐藏。我也可以使用开关盒吗?
我尝试过:
我试过但我对此知之甚少
I'm a beginner in jquery. I was wondering if its possiblet o have an if else in button. for example. I have 3 buttons, each one can change the content of a speciic paragraph. when I click one of those buttons, the two other will hide. Can I also do it using switch case?
What I have tried:
I have tried but I little knowledge about this
推荐答案
是的,当然可以。 jQuery只是一个用JavaScript编写的库。所以,你只想在javascript中编写if语句。
Yes, of course you can. jQuery is just a library written in JavaScript. So, you'll just want to write your if statement in javascript.
这篇关于是否可以在jquery中的按钮中应用if else条件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文