0

I have created a jquery to create a tab for list item and that jquery will insert element tag to style the tabs on the paeg load,but problem is that when ever the page loaded again and again the element tag also recreated .so, that element tag created many times as we visited it is created .So, i need to delete the element tag before it is created again.

<script src="/jquery.min.js" type="text/javascript"></script>
<script src="/TabsForSharePointFormscolor.js" type="text/javascript"></script>
<script type="text/javascript">

var tabConstructor = {
    tabs:[ {name:'Activity',fields:['Name'], mouseOver:'This is the first tab',tabStyle:''}],
    settings:{
        viewAllFields:{show:true,name:'All fields',mouseOver:'This tab shows all fields',tabStyle:'',clickFunction:''},  
        orphanFields:{show:true,name:'...',mouseOver:'All orphan fields',tabStyle:''},  
        breakTabRowAt:null,  
        hoverTabColor:'#FFF68F',  
        selectedTabColor:'#B9D3EE'
    }
};  

init_buildTabbedForm(tabConstructor,1);  



  </script>

In this init_buildTabbedForm will create element.

1 Answer 1

0

Try jQuery Empty. So something like

$(".tabId").empty()
5
  • I need to delete <style> </style> element completly before creating it again ,will it work,thanks for the answer.
    – krishna
    Commented Oct 29, 2013 at 6:05
  • It's hard to give more exact advice without some code samples. Can you update your original question with some of your code? Commented Oct 29, 2013 at 6:16
  • So you want to remove the 'hoverTabColor' and 'selectedTabColor' styles? Commented Oct 29, 2013 at 6:52
  • NO i need to remove the whole <style> </style> elements tag to be removed
    – krishna
    Commented Oct 29, 2013 at 9:10
  • $("#tabid").removeAttr("style"); Commented Oct 30, 2013 at 3:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.