function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
prasanth sfdcprasanth sfdc 

how to find parent siblings using jquery in vf page

Hi,   If i click on "edit" text in the below image, then i need to hide all the <apexoutputext> tag in that row and display all <apex:inputtext> tags in that same row where i click the "edit" text. So I need to get the siblings ids <apexoutputext> tag.  Please help to solve this. 

User-added image

<apex:pageBlockTable value="{!categories}" var="c">
          <apex:column width="25px">
            <apex:inputCheckbox value="{!c.checked}"/>
        <apex:column headerValue="LastName" >  <apex:outputtext value="{!}"  id="lOutname" styleclass="outval"/>
                                                <apex:inputtext value="{!}" id="linname" styleclass="inpval"/> 
        <apex:column headerValue="FirstName">   <apex:outputtext value="{!}"  id="fOutname" styleclass="outval"/>
                                                <apex:inputtext value="{!}" id="finname" styleclass="inpval"/>
        <apex:column headerValue="Department" >   <apex:outputtext value="{!}" id="Outdept" styleclass="outval"/>
                                                   <apex:inputtext value="{!}"   id="indept" styleclass="inpval"/>
        <apex:column headerValue="Edit/Save" > 
                                               <div id="editrow" onclick="editrow()"> Edit </div>  
                                               <div id="saverow"> Save </div> 


You can give a common class to all the output elements and a separate class to all the inputs and can show or hide either the outputs or inputs using the jQuery's class selector.

Vivek Shinde