I have this code snippet that works:
var oldInput = document.getElementsByName ("prio");
oldInput[0].setAttribute ("disabled", "disabled");
And this is the relevant, target-page HTML (corrected):
<div id="content">
<p>(CONTENT)</p>
<form>
<p>Priority: <input name="prio" type="text" value="285"></p>
<p>Success: <input name="succ" type="text" value="6"></p>
</form>
</div>
<table border="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td class="user">
<a href="#" class="nav" title="Logout John">Logout</a>
(User: John)
</td>
</tr>
</tbody>
</table>
See it at jsfiddle.net/Kc3BB/3.
I have 1 access-point for many users. but I want 5 users to be able to change the prio
value. You can see that the username is in the footer.
Is it possible to do that in javascript with the code above for Firefox 2.x and without jQuery?
Example:
if USER (from footer) == JOHN || LUKE || JEFF || MAX || ANDY
do nothing
else
disable PRIO BOX (from content)
This should work in Firefox 2.0:
See the updated Fiddle.