jquery-form / jquery-form/form

TagName in Element Undefined

Open
#600 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.1k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

Hallo!

If in this function it finds an element without tagName it gives an error for being undefined.

$.fn.resetForm = function() {
	return this.each(function() {
		var el = $(this);
		**var tag = this.tagName;**

I believe that it can happen in other places that also use tagName.

Greetings

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating $.fn.resetForm and inspect the highlighted this.tagName access, then identify how an element without tagName reaches this function. Reproduce the reported error and check whether other tagName uses are affected. Done means the undefined case is handled without breaking form reset behavior, with regression coverage if the repository provides a relevant test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.