We can create a <dfn> element via the document.createElement()
method:
var x = document.createElement("DFN");
Click the button to create a DFN element with some text.
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button><br><br> <script> function myFunction() {/*from w w w.j a v a 2 s . c om*/ var x = document.createElement("DFN"); var t = document.createTextNode("A definition term"); x.appendChild(t); document.body.appendChild(x); } </script> </body> </html>