when I've an input with name="id" within a form, the prop('id') method returns the input element instead of the id as string:
HTML
<form id="testform">
<input name="id">
</form>
JS
var $form = $('#testform');
var wrongId = $form.prop('id');
var correctId = $form.attr('id');
alert(wrongId); // alerts the html input element
alert(correctId); // alerts the id testform
Can anyone explain this to me?
I've prepared a fiddle: https://jsfiddle.net/zosu17se/
thanks and best