Skip to content

Code cleanup: Use jQuery style tag creation #25

@jolting

Description

@jolting

In quiz.js in the function buildQuiz() there is a strange mix of jQuery/non-jQuery syntax.

$("#linkBack").html("<a href='" + url.attr("protocol") + "://" + url.attr("host") + url.attr("directory") + "start.html'>generate new quiz</a>");

We probably should be doing this the jQuery way:

var href = $('<a>',{
    text: 'MyText',
    href: 'http://myurl.com'
});

For more details see https://foo.cs.ucsb.edu/seriousjs/index.php/JQuery:HTML_tags

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions