Can someone help me how to write the 2 lines correctly in this function:
function Arabic_fun() {
document.getElementsById("#navleft").style.padding - inline - start = "0px";
document.getElementsById("#navleft li ul").style.padding - inline - start = "0px";
}
CodePudding user response:
Issues:
- No such function
getElementsById
. Did you meangetElementById
? getElementById
does not need a#
in the parameter#navleft li ul
is not a valid id. If you want nested selectors like in CSS, usequerySelector
(single) orquerySelectorAll
(multiple elements)padding - inline - start
should bepaddingInlineStart
function Arabic_fun() {
document.getElementById("navleft").style.paddingInlineStart = "0px";
document.querySelector("#navleft li ul").style.paddingInlineStart = "0px";
}