[dm_code_snippet background=”yes” background-mobile=”yes” slim=”no” line-numbers=”no” bg-color=”#abb8c3″ theme=”dark” language=”markup” wrapped=”no” height=”” copy-text=”Copy Code” copy-confirmed=”Copied”]

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bold Text Generator</title>
</head>
<body>
    <h1>Bold Text Generator</h1>
    <input type="text" id="textInput" placeholder="Enter your text">
    <br><br>
    <button onclick="convertToBoldText()">Generate Bold Text</button>
    <div id="boldTextResult"></div>

    <script>
        function convertToBoldText() {
            var inputText = document.getElementById('textInput').value;
            var boldTextElement = document.getElementById('boldTextResult');
            
            // Split input text into individual characters and wrap each in <b> tags
            var boldText = '';
            for (var i = 0; i < inputText.length; i++) {
                boldText += '<b>' + inputText.charAt(i) + '</b>';
            }
            
            boldTextElement.innerHTML = boldText;
        }
    </script>
</body>
</html>

[/dm_code_snippet]

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *