Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the conversion between ID and Class by jQuery

Shulou Source: shulou.com Published: 2022-06-01 04:01:13 09月22日 Update

This article mainly shows you "jQuery how to achieve the conversion between ID and Class", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "jQuery how to achieve the conversion between ID and Class" this article.

Conversion between ID and Class

When changing the Window size, switch between ID and Class

$(document) .ready (function () {function checkWindowSize () {if ($(window). Width () > 1200) {$('body'). AddClass (' large');} else {$('body'). RemoveClass (' large');}} $(window) .resize (checkWindowSize);}) The above is all the content of the article "how to convert jQuery between ID and Class". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Between content articles learning help size easy to understand more organization knowledge editing industry information information channels channels switching research Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Apple Linux vpn Shulou Information