Select content using Touch Directives

  • Hello everybody.
    I was making a module for my application that will work directly with ticket for payments (here, in brazil, we call ‘boleto’).
    That is a simply document with a barcode.

    I was making a screen with only the digitable line, for mobile. But i cannot “select” the content when i use the touch directives.

    Someone can help me with another solution, i don’t like to open hand of that functionality because that conflict.

    Sorry my english.
    Thanks !!


  • Admin

    Try with document.execCommand('copy') which ia native in modern browsers. (don’t forget to programmatically select the text you want to be copied first —

    Do a search here for ‘document.execCommand’:
    It’s second response I think.

    You’ll also find browser support there:

    • IE10+
    • Google Chrome 43+ (~April 2015)
    • Mozilla Firefox 41+ (shipping ~September 2015)
    • Opera 29+ (based on Chromium 42, ~April 2015)

Log in to reply