[Koha] jquery and selectors

Owen Leonard oleonard at myacpl.org
Fri Aug 17 02:21:02 NZST 2012

> These seem to be "Koha" elements rather than standard DOM elements.  How
> would I know that, or am I missing something?

For the purposes of what you're doing there's no Koha versus "standard
DOM." jQuery looks at whatever markup is on the page. When you see

$("#memberentry_contact label[for='phone']").html("Primary Phone :");

It tells jQuery, "Look for an element on the page with the ID
attribute equal to "memberentry_contact." Inside that, find me a
<label> with the "for" attribute of "phone." Change the text contents
of that <label> to "Primary Phone :"

In the example you first quoted, referring to "opac-main-search,"
there is a <div> on each OPAC page with that ID. If you use Firebug to
inspect the blue search bar you should be able to find it in the HTML

  -- Owen

Web Developer
Athens County Public Libraries

More information about the Koha mailing list