
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
How to set line breaking rules for non-CJK scripts in JavaScript?
Use the wordbreak property in JavaScript to set line breaking rules for non-CJK scripts. The following are CJK scripts: C for Chinese, J for Japanese, K for Korean.
Example
You can try to run the following code to learn how to implement wordbreak property −
<!DOCTYPE html> <html> <head> <style> #box { width: 150px; height: 120px; background-color: lightblue; border: 1px solid black; } </style> </head> <body> <button onclick = "display()">Set</button> <div id = "box"> This is Demo Text.This is Demo Text.This is Demo Text.This is Demo Text.This is Demo Text.This is Demo Text. </div> <script> function display() { document.getElementById("box").style.wordBreak = "break-all"; } </script> </body> </html>
- Related Articles
- Specify Word Breaking Rules using CSS3
- Non-negative set subtraction in JavaScript
- How To Use TestNG Framework For Creating Selenium Scripts?
- Should the government involve private security companies to jointly manage traffic on Indian roads known for breaking rules?
- Breaking integer to maximize product in JavaScript
- How to set label for an already plotted line in Matplotlib?
- Breaking camelCase syntax in JavaScript
- How to give a warning for Non-JavaScript Browsers?
- Set Media Queries for different CSS style rules for different size devices
- What are the rules to be followed for Object Definitions in JavaScript?
- What are the basic rules for JavaScript parameters?
- How to set the type of line in a text-decoration with JavaScript?
- How to set the style for line drawing using imagesetstyle() function in PHP?
- Breaking a loop in functional programming JavaScript.
- How to set the style of the line in a text decoration with JavaScript?

Advertisements