उदाहरण
सबसे पहले <strong> एलिमेंट सेट करें:
<strong id="strongDemo">Replace This strong tag</strong>
आईडी का उपयोग करके jQuery से टेक्स्ट सेट करें:
$(document).ready(function(){
$("#strongDemo").html("Actual value of 5+10 is 15.....");
});
पूरा HTML कोड:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
<body>
<strong id="strongDemo">Replace This strong tag</strong>
<script>
$(document).ready(function(){
$("#strongDemo").html("Actual value of 5+10 is 15.....");
});
</script>
</body>
</html>
फ़ाइल को "anyName.html" के रूप में सेव करें और VS Code में "Open with Live Server" चुनें।
आउटपुट
आउटपुट में स्ट्रॉन्ग टैग का टेक्स्ट बदल जाएगा।