I'm not sure what you are trying to do exactly. Your shell example doesn't execute. I think you want to delete, for example,
<a accesskey="j" href="contrastchapter.html">Prev</a>
and
<a accesskey="k" href="ch03s02.html">Next</a>
in line 2 in your html files.
If so, why not try
#!/bin/sh
ls *.html | while read line
do
sed -i ' 1,2 {
s:<a accesskey="j" href="[[:alnum:].]*">Prev</a>::
s:<a accesskey="k" href="[[:alnum:].]*">Next</a>::
}' $line
done
I'm assuming filenames consist of alphanumerics or a period... You may have to tweak this