Get the App
SLTechnology News&Howtos  ›  Development  › 

How jQuery modifies the height of td

Shulou Source: shulou.com Published: 2022-06-02 12:28:12 10月01日 Update

This article will explain in detail how jQuery modifies the height of td. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

JQuery modify td high method: 1, use attr () method, syntax "$(" td "). Attr (" style "," height: height value; "); 2, use css () method, syntax" $("td"). Css ("height", "height value");

The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.

1. Use the attr () method

The attr () method sets the attribute value of the selected element.

$(document) .ready (function () {$("button") .click (function () {$("td") .attr ("style", "height: 50px;");}) Person information, name, age. Peter 20 Lois 20 modifies the height of td

2. Use the css () method

$(document) .ready (function () {$("button") .click (function () {$("td"). Css ("height", "50px");}) Person information, name, age. Peter 20 Lois 20 modifies the height of td

This is the end of this article on "how jQuery modifies the height of td". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Methods articles people information name age more grammar height good practical elements content attributes tutorials articles versions environment computer knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Redmi Shulou Technology Shulou Tech Info NVidia