I want to prompt the user for a CSS property and a value and change the style of the paragraphs but I can't get the property working
function change()
var prop = prompt("Enter a css property");
var val = prompt("Enter a value for the property");
var x = document.querySelectorAll("p");
for (i = 0; i < x.length; i++) {
x[i].style.prop = val;
}
}