Search code examples
moovwebtritium

In Tritium, how do I transform all <p> tags to <div> tags?


I’m working in the Moovweb SDK and am optimizing my personal desktop site for mobile.

How do I transform all my <p> tags to <div> tags? I really don't want to do it manually! Search and replace?? haha


Solution

  • You can use the name() function to change the name of an element. For example:

    $("//p") {
        name("div") 
    }
    

    See it in action here: http://tester.tritium.io/bd1be4f2c187aed317351688e23f01127d26343a