Javascript alert message bold text. The bold() method returns a string embedded in a <b> tag: <b>string</b> Jan 28, 2002 · Is it possible to display part of a text string in bold in a JavaScript alert command. org/en-US/docs/Web/API/window. mozilla. You'd need to use a custom modal to achieve that. The alert function is strictly used for text output, not html or any other format. Jul 23, 2025 · An alert box is a built-in feature in JavaScript that displays a small window with a message to the user. alert for more details. Please see https://developer. Nope not possible to show HTML content in an alert box ! Jan 28, 2002 · Is it possible to display part of a text string in bold in a JavaScript alert command. Apr 11, 2011 · 16 The alert() dialog is not rendered in HTML, and thus the HTML you have embedded is meaningless. I basically want to highlight certain parts of the message so that it stands out. It may cease to work in your browser at any time. When an alert box pops up, the user will have to click "OK" to proceed. An alert box is often used if you want to make sure information comes through to the user. Description String bold () is deprecated in JavaScript. I basically want to highlight certain parts of the message so that it May 16, 2023 · Hi , I have a requirement to show some part in bold in an alert message , can we achieve this? In JavaScript, textContent is a property that allows you to get or set the text inside an HTML element. But the JavaScript alert box is a system object not the subject of CSS. The below approaches can be used to create a custom alert box in JavaScript: Alerts Alert messages can be used to notify the user about something special: danger, success, information or warning. It's primarily used for providing information to the user, displaying warnings, or prompting the user for confirmation. The styling of the alert box is handled by the browser itself, and cannot be changed via CSS or javascript. You are best to draw your own alert modal window and style that instead. Javascript's alert function does not support HTML tags. Avoid using it. . May 16, 2023 · Solved: Hi , I have a requirement to show some part in bold in an alert message , can we achieve this? Jul 12, 2025 · Sometimes developers like us do not want to just show a normal text inside of the alert box we want to decorate that box in our own way. Feb 16, 2018 · Im sure there would be a way using javascript and a ton of code but it wouldn't work for every browser and operating system and would be buggy as heck. It includes all the text, but it ignores any HTML tags within that element. If you want more control over how the alert looks, you have to make an HTML element that looks like the alert box. yrxko wqlnufs alqgkr bowwu uto bztc awufu wms oag qtfvu