Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. html contents into plain text

html contents into plain text

Scheduled Pinned Locked Moved ASP.NET
javascripthtmltutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MalarGayu
    wrote on last edited by
    #1

    hi i am having the following function in javascript: function passvalue() { var editor = $find("<%=Editor1.ClientID%>"); var content = editor.get_content(); window.opener.document.getElementById("ctl00_cphMain_txtEditor").value = content; self.close(); } in this function in am getting the editor contents but all are in html format. can anyone plz tell me how to convert the contents into plain text. K.Gayathri

    J 1 Reply Last reply
    0
    • M MalarGayu

      hi i am having the following function in javascript: function passvalue() { var editor = $find("<%=Editor1.ClientID%>"); var content = editor.get_content(); window.opener.document.getElementById("ctl00_cphMain_txtEditor").value = content; self.close(); } in this function in am getting the editor contents but all are in html format. can anyone plz tell me how to convert the contents into plain text. K.Gayathri

      J Offline
      J Offline
      Jain Vijay
      wrote on last edited by
      #2

      var nonHTMLcontent = document.getElementById(ControlIdContainsHTMLContent).contentWindow.document.execCommand("RemoveFormat",false,null)

      Here

      ControlIdContainsHTMLContent

      contains HTML content. In

      nonHTMLcontent

      variable you will get content after removing formatting. Hope this will help.

      Regards... Vijay Jain :)

      "One thing you can't recycle is wasted time."

      M 1 Reply Last reply
      0
      • J Jain Vijay

        var nonHTMLcontent = document.getElementById(ControlIdContainsHTMLContent).contentWindow.document.execCommand("RemoveFormat",false,null)

        Here

        ControlIdContainsHTMLContent

        contains HTML content. In

        nonHTMLcontent

        variable you will get content after removing formatting. Hope this will help.

        Regards... Vijay Jain :)

        "One thing you can't recycle is wasted time."

        M Offline
        M Offline
        MalarGayu
        wrote on last edited by
        #3

        hi thanks for the reply but in the code my document.getelementbyid(" ") is not finding the element so only i am using find method.. so now how to proceed plz... K.Gayathri

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups