[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
this:

$("#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
source.

  -- Owen

-- 
Web Developer
Athens County Public Libraries
http://www.myacpl.org


More information about the Koha mailing list