⊗jqDmVMACh 34 of 113 menu

Changing the Values ​​of Multiple Attributes in jQuery

You can change the values ​​of several attributes at once, then they need to be passed as an object. For example, let's say we have the following HTML code:

<input type="text" value="!!!" id="test">

In the Javascript code, we write the attributes value, id and their values ​​as a key-value pair:

$('#test').attr({value: 'text', type: 'password'});

Now the HTML code looks like this:

<input type="password" value="text" id="test">
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline