I use Sublime Text and Emmet plug-in. Various tags do not include all the attributes automatically when I use Emmet, so I have to put them manually. For example the input tags have only "type" attribute when I enter "input" and press "Tab".
<input type="text">
but I want this for example
<input type="text" name="" id="">
How can I edit whichever attributes I want to see in a tag? I tried to find a solution on YouTube and through Google search but was not successful.
The Emmet syntax is modelled after CSS selectors, so in order to add attributes (or properties), you need pass them in square brackets.
Example
Input:
input#first_name[type=text][name=first_name]
Output:
<input type="text" id="first_name" name="first_name">
As for your example, you would need to type this:
input[type=text][name]#
This breaks down as follows:
input - name of the tagtype attribute with the value of textname attribute without valueid attributeEdit:
The type attribute stands for :, so you could write this as:
input:text[name]#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With