ZVON > References > DOM1 Reference

createComment (method)

Owning interface and usage:  
Document.createComment(data)

Member of these other interfaces :  
none

Description:  
Creates a Comment node given the specified string.

Parameters:  
DOMString data  -  String data for the node.

Returns:  
Comment -  The new Comment object.

Exceptions:  
none


Example:
JavaScript:
  var comm = document.createComment('This is some comment.');
  var output1 = comm.nodeType;
  var output2 = comm.data;
Output:
desired your browser
output1: 8
output2: This is some comment.