Able to get ID but unable to get value from element

Hello all,

the following part creates an editable element.
Upon exiting the element “test” is called.
It returns the id of the element but gives an undefined for the value.

		myString = "";
		for (var S = 0; S < arrInbound[i][3].length; S++){ 
		myString = myString + "<p contenteditable='true'  className = 'crewNames' id='" + S +  tagElRight.id + "' onblur='test(this)'>" + arrInbound[i][3][S] + "</p><br>";
		}

function test(e){
	id = e.id;
	V1 = e.value
	
	alert(id + " | " + V1);
}

All help is welcome

Paragraph elements simply don’t have values.

Thanks m3g4p0p!
Is there a way to get its content?

That would be e.textContent, or if you want the full HTML, e.innerHTML.

That worked, many thanks!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.