Rightn ow all functions only manipulate html strings and set html content. Would be useful for sutdents to learn to manipulate DOM directly; this is somewhat confused & confusing at present.
here's some code to start with
/* Problem 1d: Write a simple function that generates an HTML elemnt
* object when passed two variables: tag CONTENT and and tag NAME. So
* for instance, `tagItElement ("look at me!", "div")` should return a JavaScript dom object...
*/
/**
* return a string of the form <tagName>content</tagName>, where `content`
* and `tagName` are string parameters passed to the function.
* @param {string} content
* @param {string} tagName
* @returns {string}
*/
function tagItElement(content, tagName) {
return $
return '';
}
Rightn ow all functions only manipulate html strings and set html content. Would be useful for sutdents to learn to manipulate DOM directly; this is somewhat confused & confusing at present.
here's some code to start with