Extend buttons and get entire cell contents

Extend buttons and get entire cell contents

greenflashgreenflash Posts: 58Questions: 5Answers: 0
edited August 2023 in Free community support

I'm trying to create a button that copies email addresses to the clipboard. I can do it OK if the column just contains an email address using

      extend: 'copy',
      text: 'Copy email address'
      header: false,
      title: null,
      customize: function(data) {
        return data.replace(/\n/g, ', ').replace(/\r/g, '');
      },
      exportOptions: {
        columns: '#my_col'
      }

but how do I get the entire cell contents if the cell contains HTML such as

<a href="joe@example.com">Joe Bloggs</a>

so that I can process the data and extract the href attribute values? The code above just seems to give me "Joe Bloggs".

Answers

Sign In or Register to comment.