دنبال کننده ها

۱۳۹۶ آذر ۱۲, یکشنبه

javascript - a robust way to toggle item display in Jquery

[ad_1]



I want to toggle whether to display an item I should do the following:



$(item).css("display", "none")
$(item).css("display", "block")


But this method is not robust enough, given that the item might be "display: flex" or "display: table".



I think in react, I can just delete that element and re-render it when I need to, but is there any simple way to do that using jQuery besides directly modify the html to delete that element?



Thanks.




[ad_2]

لینک منبع