Syntax.js - Example - Basic

This is an example of of how to use Syntax.js to highlight the code in a DOM element.

Download Now

v3.0.1 - 18th Jul 2024
                                var something = true;
                
                                if ( something ) {
                                    console.log( "Output is written." ); // Comment
                                    
                                    /* Multi-line
                                    comment */
                                }
                            
Code
                                
                                    
                                        var something = true;
                        
                                        if ( something ) {
                                            console.log( "Output is written." ); // Comment
                                            
                                            /* Multi-line
                                            comment */
                                        }