मैं JS के माध्यम से कुछ html बनाना चाहता हूं, इसलिए मुझे JS फ़ाइल के अंदर html लिखने की आवश्यकता है:
function createHtmlSection() {
return "<li class=\"chapter up-wrapper-btn\">" +
"<div>" +
"<button><i class=\"fa fa-plus\" onclick=\"addSection('up',this)\"></i></button>" +
"<label contenteditable=\"true\">section 1</label>" +
"</div>" +
"</li>";
}
क्या इस प्रकार का html स्ट्रिंग बनाने के लिए कोई टूल या कुछ शॉर्टकट है?
मेरा मतलब है, इस मामले में मुझे यह सब html हाथ से टाइप करने की जरूरत थी। के साथ +और "संकेत जोड़ने की जरूरत है ।
कुछ जो इसे परिवर्तित कर सकते हैं:
<li class="chapter up-wrapper-btn">
<div>
<button><i class="fa fa-plus" onclick="addSection('up',this)"></i></button>
<label contenteditable="true">section 1</label>
</div>
</li>
पहली स्ट्रिंग के लिए जिसे मुझे हाथ से टाइप करना था