Preserve Formatting
कभी-कभी, आप चाहते हैं कि आपका टेक्स्ट HTML दस्तावेज़ में लिखे गए प्रारूप के सटीक प्रारूप का पालन करे। इन मामलों में, आप पहले से प्रारूपित टैग <pre> का उपयोग कर सकते हैं।
ओपनिंग <pre> टैग और क्लोजिंग </pre> टैग के बीच कोई भी टेक्स्ट सोर्स डॉक्यूमेंट के फॉर्मेटिंग को सुरक्षित रखेगा।
<!DOCTYPE html> <html> <head> <title>Preserve Formatting Example</title> </head> <body> <pre> function testFunction( strText ){ alert (strText) } </pre> </body> </html>
This will produce the following result −
function testFunction( strText ){ alert (strText) }
Try using the same code without keeping it inside <pre>…</pre> tags