Comment()

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Comment () konstruktoru yeni yaradılmış Comment obyektini mətn məzmunu olaraq parametrdə verilən isteğe bağlı DOMString qaytarır.

Syntax

comment1 = new Comment(); // Create an empty comment
comment2 = new Comment("This is a comment");

ax

comment1 = new Comment(); // Create an empty comment
comment2 = new Comment("This is a comment");

Example

var comment = new Comment("Test");

Specifications

Specification Status Comment
DOM
The definition of 'Comment: Comment' in that specification.
Living Standard Initial definition

Browser compatibility

BCD tables only load in the browser

Note: For browsers where this constructor is not supported, Document.createComment() may be suitable.

See also