quotation marks around the attribute value of an element

Javascript has a function called querySelector, which is used to get the dom object of an element based on some condition specified as the parameter of the function, such as

var ele=document.querySelector(‘[someattribute=somevalue]’);

The above statement get the first element which has an attribute someattribute and the attribute value is somevalue. If there is no such element with that attribute or the value of the attribute is not somevalue, the function will return null.

The attribute of an element can be specified as <someelement someattribute=”somevalue”> or <someelement someattribute=somevalue>(note that the quotation marks around the attribute value are missing) . For both specifications, the element can be retrieved successfully by document.querySelector(‘[someattribute=somevalue]’) or document.querySelector(‘[someattribute=\”somevalue\”]’), i.e., the quotes around the attribute value can be ignored.

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:

Comments are closed, but trackbacks and pingbacks are open.