function
funDir() {
if
(document.getElementById(
'p1'
).dir ==
'ltr'
) {
document.getElementById(
).dir =
'rtl'
;
}
else
{
'd1'
).innerHTML =
'<h3>'
+ document.getElementById(
).dir +
'</h3>'
window.onload =
() {
'b1'
).onclick = funDir;
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
script
src
"js/script.js"
></
</
body
p
id
"p1"
dir
"ltr"
>Hello World!</
input
type
"button"
"b1"
value
"exchange"
div
"d1"